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 { Events } from './views/Events'; import { Interfaces } from './views/Interfaces'; import { Spinner } from './components/ui'; export type View = | 'dashboard' | 'contacts' | 'registrations' | 'sponsors' | 'schedule' | 'activity' | 'events' | 'interfaces'; 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: 'events', label: 'Events', ico: '📅' }, { id: 'interfaces', label: 'Interfaces', 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 === 'events' && } {view === 'interfaces' && }
); } export function App() { return ( ); }