import { BrowserRouter, Navigate, Route, Routes } from "react-router-dom"

import { HomeScreen } from "@/components/home/HomeScreen"
import { AppShell } from "@/components/layout/AppShell"
import { LanguageProvider } from "@/lib/language"
import { BuilderScreen } from "@/screens/BuilderScreen"
import { PantryScreen } from "@/screens/PantryScreen"
import { PlateScreen } from "@/screens/PlateScreen"
import { SettingsScreen } from "@/screens/SettingsScreen"
import { WeekPlanScreen } from "@/screens/WeekPlanScreen"

export default function App() {
  return (
    <LanguageProvider>
      <BrowserRouter>
        <Routes>
          <Route element={<AppShell />}>
            <Route index element={<HomeScreen />} />
            <Route path="pantry" element={<PantryScreen />} />
            <Route path="knowledge" element={<PlateScreen />} />
            <Route path="weekplan" element={<WeekPlanScreen />} />
            <Route path="builder" element={<BuilderScreen />} />
            <Route path="settings" element={<SettingsScreen />} />
            <Route path="*" element={<Navigate to="/" replace />} />
          </Route>
        </Routes>
      </BrowserRouter>
    </LanguageProvider>
  )
}
