import "./styles/App.css";
import Layout from "./components/layout/layout";
import Login from "./pages/Login/Login";
import Dashboard from "./pages/Dashboard/Dashboard";
import CafeManagement from "./pages/CafeManagement/CafeManagement";
import EditCafe from "./pages/CafeManagement/EditCafe";
import Stats from "./pages/Stats/Stats";
import { BrowserRouter, Routes, Route, Navigate } from "react-router-dom";

function App() {
    return (
        <BrowserRouter>
            <Routes>
                <Route path="/login" element={<Login />} />

                <Route path="/" element={<Layout />}>
                    <Route index element={<Navigate to="/dashboard" replace />} />

                    <Route path="dashboard" element={<Dashboard />} />

                    <Route path="cafe-management" element={<CafeManagement />} />

                    <Route path="edit-cafe/:id" element={<EditCafe />} />

                    <Route path="stats" element={<Stats />} />
                </Route>
            </Routes>
        </BrowserRouter>
    );
}

export default App;