diff --git a/app/app/layout.tsx b/app/app/layout.tsx index 648acfb..9d8dd28 100644 --- a/app/app/layout.tsx +++ b/app/app/layout.tsx @@ -6,6 +6,7 @@ import { Footer } from '@/components/footer' import { ThemeProvider } from '@/components/ThemeProvider' import { GoogleAnalytics } from '@next/third-parties/google' import Navbar from '@/components/navbar' +import { DisclaimerBanner } from '@/components/disclaimer-banner' const inter = Inter({ subsets: ['latin'] }) @@ -50,6 +51,7 @@ export default function RootLayout({
+
{children}
diff --git a/app/components/disclaimer-banner.tsx b/app/components/disclaimer-banner.tsx new file mode 100644 index 0000000..20b350a --- /dev/null +++ b/app/components/disclaimer-banner.tsx @@ -0,0 +1,60 @@ +"use client"; + +import { useState, useEffect } from "react"; +import { AlertTriangle, X } from "lucide-react"; + +const ALWAYS_SHOW = process.env.NEXT_PUBLIC_ALWAYS_SHOW_DISCLAIMER === "true"; + +export function DisclaimerBanner() { + const [dismissed, setDismissed] = useState(false); + const [isLocalhost, setIsLocalhost] = useState(!ALWAYS_SHOW); + + useEffect(() => { + if (ALWAYS_SHOW) return; + const host = window.location.hostname; + setIsLocalhost(host === "localhost" || host === "127.0.0.1"); + }, []); + + if (dismissed || isLocalhost) { + return null; + } + + return ( +
+
+
+ +

+ This tool has not been audited and is provided as a proof of concept. + Use at your own risk per our{" "} + + Terms of Service + + . Where possible, you should{" "} + + run this tool locally + + . +

+
+ +
+
+ ); +}