fix(frontend): add 404 fallback route for unknown paths (#6373)
This commit is contained in:
committed by
GitHub
parent
5e31975cc3
commit
c5ac29c81d
@@ -2,6 +2,7 @@ import { Routes, Route } from "react-router-dom";
|
||||
import Home from "./pages/home";
|
||||
import MyAgents from "./pages/my-agents";
|
||||
import Workspace from "./pages/workspace";
|
||||
import NotFound from "./pages/not-found";
|
||||
|
||||
function App() {
|
||||
return (
|
||||
@@ -9,6 +10,7 @@ function App() {
|
||||
<Route path="/" element={<Home />} />
|
||||
<Route path="/my-agents" element={<MyAgents />} />
|
||||
<Route path="/workspace" element={<Workspace />} />
|
||||
<Route path="*" element={<NotFound />} />
|
||||
</Routes>
|
||||
);
|
||||
}
|
||||
|
||||
@@ -0,0 +1,19 @@
|
||||
import { Link } from "react-router-dom";
|
||||
|
||||
export default function NotFound() {
|
||||
return (
|
||||
<div className="min-h-screen bg-background flex flex-col items-center justify-center px-6 text-center">
|
||||
<h1 className="text-5xl font-semibold text-foreground">404</h1>
|
||||
<p className="mt-3 text-sm text-muted-foreground">Page not found</p>
|
||||
<p className="mt-1 text-sm text-muted-foreground/80">
|
||||
The page you’re looking for doesn’t exist.
|
||||
</p>
|
||||
<Link
|
||||
to="/"
|
||||
className="mt-6 inline-flex items-center rounded-lg border border-border/40 px-4 py-2 text-sm font-medium text-foreground hover:bg-muted/40 transition-colors"
|
||||
>
|
||||
Back to Home
|
||||
</Link>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user