import { Route, Switch } from "wouter"
import { HomePage } from "@/pages/home"
import { JoinPage } from "@/pages/join"
import { RoomPage } from "@/pages/room"
import { AdminPage } from "@/pages/admin"

export function App() {
  return (
    <Switch>
      <Route path="/" component={HomePage} />
      <Route path="/join/:code">
        {(params) => <JoinPage code={params.code.toUpperCase()} />}
      </Route>
      <Route path="/room/:code">
        {(params) => <RoomPage code={params.code.toUpperCase()} />}
      </Route>
      <Route path="/admin" component={AdminPage} />
      <Route>
        <div className="flex min-h-svh items-center justify-center p-6">
          <p className="text-muted-foreground text-sm">Page introuvable.</p>
        </div>
      </Route>
    </Switch>
  )
}
