import { useState } from 'react'; import { AuthProvider, useAuth } from './context/AuthContext'; import { ToastProvider } from './context/ToastContext'; import { Login } from './screens/Login'; import { Dashboard } from './views/Dashboard'; import { Contacts } from './views/Contacts'; import { Registrations } from './views/Registrations'; import { Sponsors } from './views/Sponsors'; import { Schedule } from './views/Schedule'; import { Activity } from './views/Activity'; import { Raffle } from './views/Raffle'; import { BadgeEditor } from './views/BadgeEditor'; import { Printing } from './views/Printing'; import { Events } from './views/Events'; import { Interfaces } from './views/Interfaces'; import { Reports } from './views/Reports'; import { Settings } from './views/Settings'; import { Settings as SettingsIcon } from 'lucide-react'; import { Spinner } from './components/ui'; import { PrinterStatusPill } from './components/PrinterStatusPill'; import { PrintStatusProvider } from './lib/printStatus'; export type View = | 'dashboard' | 'contacts' | 'registrations' | 'sponsors' | 'schedule' | 'activity' | 'raffle' | 'badges' | 'printing' | 'events' | 'interfaces' | 'reports' | 'settings'; const NAV: { id: View; label: string; ico: string }[] = [ { id: 'dashboard', label: 'Dashboard', ico: '📊' }, { id: 'contacts', label: 'Contacts', ico: '👥' }, { id: 'registrations', label: 'Registrations', ico: '🎟️' }, { id: 'sponsors', label: 'Sponsors', ico: '🤝' }, { id: 'schedule', label: 'Schedule', ico: '🗓️' }, { id: 'activity', label: 'Activity', ico: '⚡' }, { id: 'raffle', label: 'Raffle', ico: '🎯' }, { id: 'badges', label: 'Badges', ico: '🎫' }, { id: 'printing', label: 'Printing', ico: '🖨️' }, { id: 'events', label: 'Events', ico: '📅' }, { id: 'interfaces', label: 'Interfaces', ico: '🔌' }, { id: 'reports', label: 'Reports', ico: '📤' }, { id: 'settings', label: 'Settings', ico: '' }, ]; function Shell() { const { contact, loading, signOut } = useAuth(); const [view, setView] = useState('dashboard'); if (loading) { return (
); } if (!contact) return ; return (
{view === 'dashboard' && } {view === 'contacts' && } {view === 'registrations' && } {view === 'sponsors' && } {view === 'schedule' && } {view === 'activity' && } {view === 'raffle' && } {view === 'badges' && } {view === 'printing' && } {view === 'events' && } {view === 'interfaces' && } {view === 'reports' && } {view === 'settings' && }
); } export function App() { return ( ); }