import { NavLink, Outlet, useLocation } from 'react-router-dom' import { navApps } from '../lib/acAssets' import type { AcAppKey } from '../lib/acAssets' import { useAuth } from '../auth/AuthContext' import { AuthTicketIcon, SceneDecor } from './AuthDecor' import { AcIcon } from './AcIcon' import { MobileBottomNav } from './MobileBottomNav' import { ThemeToggle } from './ThemeToggle' function AppTile({ to, label, icon, end, matchPrefix, }: { to: string label: string icon: AcAppKey end?: boolean matchPrefix?: string }) { const { pathname } = useLocation() return ( { const prefixActive = matchPrefix ? pathname.startsWith(matchPrefix) : false const active = isActive || prefixActive return `ac-app-tile ${active ? 'ac-app-tile--active' : ''}` }} > {label} ) } export function Layout() { const { member, uid, logout } = useAuth() return (

Haixun Patrol

巡樓管理台

{member?.roles?.[0] || 'member'}
) }