"use client"; import { Building2, ClipboardCheck, FileArchive, Gauge, LayoutDashboard, LogOut, MapPin, Shield, Stethoscope, UserRound } from "lucide-react"; import Link from "next/link"; import { usePathname, useRouter } from "next/navigation"; import { useEffect } from "react"; import { useAuth } from "@/components/auth"; import { BrandLogo } from "@/components/brand/brand-logo"; const navigation = [ { href: "/dashboard", label: "Dashboard", icon: LayoutDashboard }, { href: "/customers", label: "Kunden", icon: Building2 }, { href: "/locations", label: "Standorte", icon: MapPin }, { href: "/contacts", label: "Ansprechpartner", icon: UserRound }, { href: "/devices", label: "Geraete", icon: Stethoscope }, { href: "/equipment", label: "Pruefmittel", icon: Gauge }, { href: "/validations", label: "Validierungen", icon: ClipboardCheck }, { href: "/documents", label: "Dokumente", icon: FileArchive }, { href: "/users", label: "Benutzer", icon: Shield, adminOnly: true } ]; export function AppShell({ children }: { children: React.ReactNode }) { const pathname = usePathname(); const router = useRouter(); const auth = useAuth(); useEffect(() => { if (auth.user?.must_change_password && pathname !== "/profile/security") { router.push("/profile/security"); } }, [auth.user?.must_change_password, pathname, router]); return (
{children}
); }