Skip to content

Commit

Permalink
feat: add an error fallback
Browse files Browse the repository at this point in the history
  • Loading branch information
frectonz committed Jun 14, 2024
1 parent 29cb34e commit 9636ce4
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 } from "lucide-react";
import { Menu, Database, Frown } from "lucide-react";
import { createRootRoute, Link, Outlet } from "@tanstack/react-router";

import { Button } from "@/components/ui/button";
Expand All @@ -15,6 +15,7 @@ const TanStackRouterDevtools = import.meta.env.PROD

export const Route = createRootRoute({
component: Root,
errorComponent: ErrorComponent,
});

export function Root() {
Expand Down Expand Up @@ -130,3 +131,14 @@ function Github({ className }: { className: string }) {
</svg>
);
}

function ErrorComponent() {
return (
<div className="w-screen h-screen text-red-500 flex flex-col items-center justify-center gap-6">
<Frown className="w-12 h-12" />
<h1 className="scroll-m-20 text-3xl tracking-tight lg:text-4xl">
Something Went Wrong.
</h1>
</div>
);
}

0 comments on commit 9636ce4

Please sign in to comment.