import { useState } from 'react' import { DollarSign, CalendarDays, TrendingUp, BarChart3, Wallet, Settings, Menu } from 'lucide-react' import AuthGate, { useAuth } from './components/AuthGate' import { UpdateBanner } from './components/UpdateBanner' import { useVersionCheck } from './hooks/useVersionCheck' import { can } from './types' import Weekly from './pages/Weekly' import Monthly from './pages/Monthly' import Rolling12Weeks from './pages/Rolling12Weeks' import Rolling12Months from './pages/Rolling12Months' import Budgets from './pages/Budgets' import SettingsPage from './pages/Settings' type Page = 'weekly' | 'monthly' | 'rolling-weeks' | 'rolling-months' | 'budgets' | 'settings' const NAV: { id: Page; label: string; icon: React.ElementType; cap?: string }[] = [ { id: 'weekly', label: 'Weekly', icon: CalendarDays }, { id: 'monthly', label: 'Monthly', icon: TrendingUp }, { id: 'rolling-weeks', label: '12 Weeks', icon: BarChart3 }, { id: 'rolling-months', label: '12 Months', icon: BarChart3 }, { id: 'budgets', label: 'Budgets', icon: Wallet, cap: 'budget' }, { id: 'settings', label: 'Settings', icon: Settings, cap: 'settings' }, ] function Shell() { const { user } = useAuth() const [page, setPage] = useState('weekly') const [menuOpen, setMenuOpen] = useState(false) const hotelName = import.meta.env.VITE_HOTEL_NAME || 'Hotel' const visibleNav = NAV.filter(n => !n.cap || can(user, n.cap)) function selectPage(id: Page) { setPage(id) setMenuOpen(false) } return (
{menuOpen &&
setMenuOpen(false)} />}
Wage Costs
{page === 'weekly' && } {page === 'monthly' && } {page === 'rolling-weeks' && } {page === 'rolling-months' && } {page === 'budgets' && } {page === 'settings' && }
) } export default function App() { const updateAvailable = useVersionCheck('/wages/health') return ( <> ) }