diff --git a/next.config.js b/next.config.js index 400310d..58035f9 100644 --- a/next.config.js +++ b/next.config.js @@ -1,5 +1,10 @@ +const packageJson = require('./package.json') + /** @type {import('next').NextConfig} */ const nextConfig = { + env: { + APP_VERSION: packageJson.version, + }, output: 'standalone', async headers() { return [ diff --git a/src/app/layout.tsx b/src/app/layout.tsx index 00975bd..f1916bd 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -4,6 +4,7 @@ import './globals.css' import { Toaster } from '@/components/ui/toaster' import { AuthProvider } from '@/components/providers/auth-provider' import { ServiceWorkerRegister } from '@/components/providers/sw-register' +import { CookieConsent } from '@/components/ui/cookie-consent' const inter = Inter({ subsets: ['latin'], @@ -109,6 +110,7 @@ export default function RootLayout({ {children} + diff --git a/src/app/page.tsx b/src/app/page.tsx index 57e7ddd..8908b7a 100644 --- a/src/app/page.tsx +++ b/src/app/page.tsx @@ -500,6 +500,7 @@ export default function LandingPage() {

© {new Date().getFullYear()} Lageplan — Purepixel. Alle Rechte vorbehalten.

Taktische Symbole: Bildquelle Feuerwehr Koordination Schweiz FKS

+

v{process.env.APP_VERSION}

diff --git a/src/components/layout/topbar.tsx b/src/components/layout/topbar.tsx index 05698c1..26fdaef 100644 --- a/src/components/layout/topbar.tsx +++ b/src/components/layout/topbar.tsx @@ -147,6 +147,7 @@ export function Topbar({
Lageplan + v{process.env.APP_VERSION}
diff --git a/src/components/ui/cookie-consent.tsx b/src/components/ui/cookie-consent.tsx new file mode 100644 index 0000000..726fe3e --- /dev/null +++ b/src/components/ui/cookie-consent.tsx @@ -0,0 +1,70 @@ +'use client' + +import { useState, useEffect } from 'react' +import Link from 'next/link' +import { Button } from '@/components/ui/button' +import { Cookie } from 'lucide-react' + +export function CookieConsent() { + const [visible, setVisible] = useState(false) + + useEffect(() => { + const consent = localStorage.getItem('cookie-consent') + if (!consent) { + const timer = setTimeout(() => setVisible(true), 1000) + return () => clearTimeout(timer) + } + }, []) + + const accept = () => { + localStorage.setItem('cookie-consent', 'accepted') + setVisible(false) + } + + const decline = () => { + localStorage.setItem('cookie-consent', 'declined') + setVisible(false) + } + + if (!visible) return null + + return ( +
+
+
+
+ +
+
+

+ Wir verwenden Cookies +

+

+ Diese Website verwendet technisch notwendige Cookies, um die Authentifizierung und + grundlegende Funktionen zu ermöglichen. Es werden keine Tracking- oder Werbe-Cookies eingesetzt. + Weitere Informationen findest du in unserer{' '} + + Datenschutzerklärung + . +

+
+ + +
+
+
+
+
+ ) +}