import { useState } from 'react'; import { Link, Outlet, useNavigate } from 'react-router-dom'; import { LogOut, Moon, Sun } from 'lucide-react'; import { useAuth } from '@/hooks/useAuth'; import { useTheme } from '@/hooks/useTheme'; import { APP_NAME } from '@/utils/constants'; import { cn } from '@/lib/utils'; /** * Full-viewport admin shell — not the mobile PWA frame. * Journey AppHeader / app-mobile-shell are intentionally absent. */ export function AdminLayout() { const { user, signOut } = useAuth(); const { toggleTheme, isDark } = useTheme(); const navigate = useNavigate(); const [confirmLogout, setConfirmLogout] = useState(false); const handleSignOut = async () => { await signOut(); setConfirmLogout(false); navigate('/login', { replace: true }); }; return (

{APP_NAME} | پنل ادمین

{user?.email ? (

{user.email}

) : null}
بازگشت به اپ
{confirmLogout ? (

خروج از پنل ادمین

از حساب کاربری خارج می‌شوید؟

) : null}
); }