import { BrowserRouter, Route, Routes } from "react-router-dom";
import { PwaUpdatePrompt } from "./components/pwa/PwaUpdatePrompt";
import { ChatLayout } from "./components/layout/ChatLayout";
import { AvatarProvider } from "./context/AvatarContext";
import { BootstrapProvider } from "./context/BootstrapContext";
import { ChatProvider } from "./context/ChatContext";
import { ChatPage } from "./routes/ChatPage";
import { SettingsPage } from "./routes/SettingsPage";

export function App() {
	return (
		<BrowserRouter>
			<BootstrapProvider>
				<AvatarProvider>
					<ChatProvider>
						<Routes>
							<Route path="/" element={<ChatLayout />}>
								<Route index element={<ChatPage />} />
							</Route>
							<Route path="/settings" element={<SettingsPage />} />
						</Routes>
						<PwaUpdatePrompt />
					</ChatProvider>
				</AvatarProvider>
			</BootstrapProvider>
		</BrowserRouter>
	);
}
