Skip to content

Commit

Permalink
feat: add a page not found fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
frectonz committed Jun 14, 2024
1 parent 9636ce4 commit bcd6cfb
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion ui/src/routes/__root.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from "react";
import { Menu, Database, Frown } from "lucide-react";
import { Menu, Database, Frown, Cat } from "lucide-react";
import { createRootRoute, Link, Outlet } from "@tanstack/react-router";

import { Button } from "@/components/ui/button";
Expand All @@ -16,6 +16,7 @@ const TanStackRouterDevtools = import.meta.env.PROD
export const Route = createRootRoute({
component: Root,
errorComponent: ErrorComponent,
notFoundComponent: NotFoundComponent,
});

export function Root() {
Expand Down Expand Up @@ -142,3 +143,14 @@ function ErrorComponent() {
</div>
);
}

function NotFoundComponent() {
return (
<div className="py-52 w-full h-full flex flex-col items-center justify-center gap-6">
<Cat className="w-20 h-20" />
<h1 className="scroll-m-20 text-3xl tracking-tight lg:text-4xl">
Page Not Found
</h1>
</div>
);
}

0 comments on commit bcd6cfb

Please sign in to comment.