import { useNavigate } from "react-router-dom"; import { useState, type ReactNode } from "react"; import { useAuth } from "../auth/AuthContext"; type AppShellProps = { children: ReactNode; variant?: "admin" | "mobile"; hasPrimaryAction?: boolean; projectName?: string; }; export function AppShell({ children, variant = "admin", hasPrimaryAction = false, projectName }: AppShellProps) { const { user, logout } = useAuth(); const navigate = useNavigate(); const [loggingOut, setLoggingOut] = useState(false); const handleLogout = async () => { setLoggingOut(true); try { await logout(); navigate(variant === "admin" ? "/admin/login" : "/staff/login", { replace: true }); } finally { setLoggingOut(false); } }; return (