2025-09-20 00:09:00 +08:00
|
|
|
import { BrowserRouter, Routes, Route, Navigate } from "react-router-dom";
|
|
|
|
|
import { Toaster } from "sonner";
|
|
|
|
|
import Header from "@/components/common/Header";
|
|
|
|
|
import routes from "./routes";
|
|
|
|
|
|
|
|
|
|
function App() {
|
|
|
|
|
return (
|
|
|
|
|
<BrowserRouter>
|
|
|
|
|
<Toaster position="top-right" />
|
2025-10-22 15:12:59 +08:00
|
|
|
<div className="min-h-screen gradient-bg">
|
2025-09-20 00:09:00 +08:00
|
|
|
<Header />
|
2025-10-22 15:12:59 +08:00
|
|
|
<main className="container-responsive py-4 md:py-6">
|
2025-09-20 00:09:00 +08:00
|
|
|
<Routes>
|
|
|
|
|
{routes.map((route) => (
|
|
|
|
|
<Route
|
|
|
|
|
key={route.path}
|
|
|
|
|
path={route.path}
|
|
|
|
|
element={route.element}
|
|
|
|
|
/>
|
|
|
|
|
))}
|
|
|
|
|
<Route path="*" element={<Navigate to="/" replace />} />
|
|
|
|
|
</Routes>
|
|
|
|
|
</main>
|
|
|
|
|
</div>
|
|
|
|
|
</BrowserRouter>
|
|
|
|
|
);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export default App;
|