import { h, type FunctionComponent } from 'preact' import { useState } from 'preact/hooks' import { Router } from 'preact-router' import CurrentUserContext from '../contexts/current_user.ts' import { NotificationsProvider } from '../contexts/notifications.tsx' import routes from '../routes.ts' import Route from './route.tsx' import CurrentUser from './current_user.tsx' import Navigation from './navigation.tsx' import Notifications from './notifications.tsx' import NotFoundPage from './not_found_page.tsx' import s from './app.module.scss' const App: FunctionComponent<{ state: ANY }> = ({ state }) => { const [user, setUser] = useState(state.user) return (
Carson Admin
{user && ( )}
{routes ?.flatMap((route) => route.routes || route) .map(({ auth, component, path }) => ( ))}
) } export default App