"use client"; import type { ReactNode } from "react"; import Link from "next/link"; import { usePathname, useRouter } from "next/navigation"; import { Button } from "@/components/ui/button"; import { cn } from "@/lib/utils"; import { useAuthStore } from "@/store/useAuthStore"; type NavItem = { href: string; label: string; shortLabel: string; icon: (active: boolean) => ReactNode; }; const NAV_ITEMS: NavItem[] = [ { href: "/", label: "Command Center", shortLabel: "Home", icon: (active) => ( ), }, { href: "/curriculum", label: "30-Day Plan", shortLabel: "30-Day", icon: (active) => ( ), }, { href: "/record", label: "Camera Studio", shortLabel: "Studio", icon: (active) => ( ), }, { href: "/tech-news", label: "Tech News Lab", shortLabel: "News", icon: (active) => ( ), }, { href: "/exercises", label: "Daily Drills", shortLabel: "Drills", icon: (active) => ( ), }, { href: "/progress", label: "Progress & Compare", shortLabel: "Progress", icon: (active) => ( ), }, ]; type AppShellProps = { children: ReactNode; title?: string; subtitle?: string; eyebrow?: string; actions?: ReactNode; maxWidthClass?: string; }; export function AppShell({ children, title, subtitle, eyebrow, actions, maxWidthClass = "max-w-7xl", }: AppShellProps) { const pathname = usePathname(); const router = useRouter(); const userEmail = useAuthStore((state) => state.userEmail); const logout = useAuthStore((state) => state.logout); const isActive = (href: string) => { if (href === "/") return pathname === "/"; return pathname === href || pathname?.startsWith(`${href}/`); }; const handleLogout = async () => { await logout(); router.replace("/login"); }; return (

Speech-Machine

Tech Presenter Coach

{pathname !== "/record" && ( )} {userEmail && ( {userEmail} )}
{(title || actions) && (
{eyebrow && (

{eyebrow}

)} {title && (

{title}

)} {subtitle &&

{subtitle}

}
{actions &&
{actions}
}
)} {children}
); }