2026-10-02 22:26:34 -04:00
|
|
|
import { useState } from 'react'
|
|
|
|
|
import { QueryClient, QueryClientProvider } from '@tanstack/react-query'
|
|
|
|
|
import { Route, Routes } from 'react-router'
|
2026-10-03 18:40:34 -04:00
|
|
|
import { PlaceholderPage } from './pages/PlaceholderPage.tsx'
|
|
|
|
|
import { AppShell } from './shell/AppShell.tsx'
|
2026-10-02 22:26:34 -04:00
|
|
|
|
2026-10-03 18:40:34 -04:00
|
|
|
// Every route the app serves, with the heading its placeholder page shows.
|
|
|
|
|
export const routes = [
|
|
|
|
|
{ path: '/', title: 'Home' },
|
|
|
|
|
{ path: '/onboarding', title: 'Onboarding' },
|
|
|
|
|
{ path: '/plan', title: 'Plan' },
|
|
|
|
|
{ path: '/plan/shopping', title: 'Supply run' },
|
|
|
|
|
{ path: '/plan/shopping/archive', title: 'Supply archive' },
|
|
|
|
|
{ path: '/discover', title: 'Discover' },
|
|
|
|
|
{ path: '/quick', title: 'Quick dinners' },
|
|
|
|
|
{ path: '/cook-from-pantry', title: 'Cook from what I have' },
|
|
|
|
|
{ path: '/dinner/:id', title: 'Dinner' },
|
|
|
|
|
{ path: '/settings', title: 'Settings' },
|
|
|
|
|
{ path: '/settings/notifications', title: 'Notifications' },
|
|
|
|
|
{ path: '/settings/ai', title: 'AI assistant' },
|
|
|
|
|
{ path: '/settings/household', title: 'Household' },
|
|
|
|
|
{ path: '/settings/regulars', title: 'Regulars' },
|
|
|
|
|
{ path: '/settings/calendar', title: 'Calendar' },
|
|
|
|
|
] as const
|
2026-10-02 22:26:34 -04:00
|
|
|
|
|
|
|
|
// App expects to be rendered inside a router (BrowserRouter in main.tsx,
|
|
|
|
|
// MemoryRouter in tests).
|
|
|
|
|
export default function App() {
|
|
|
|
|
const [queryClient] = useState(() => new QueryClient())
|
|
|
|
|
return (
|
|
|
|
|
<QueryClientProvider client={queryClient}>
|
|
|
|
|
<Routes>
|
2026-10-03 18:40:34 -04:00
|
|
|
<Route element={<AppShell />}>
|
|
|
|
|
{routes.map(({ path, title }) => (
|
|
|
|
|
<Route key={path} path={path} element={<PlaceholderPage title={title} />} />
|
|
|
|
|
))}
|
|
|
|
|
</Route>
|
2026-10-02 22:26:34 -04:00
|
|
|
</Routes>
|
|
|
|
|
</QueryClientProvider>
|
|
|
|
|
)
|
|
|
|
|
}
|