| 1 | import { Outlet } from "react-router"; |
| 2 | |
| 3 | import type { Route } from "./+types/page-boundary"; |
| 4 | import { RouteError } from "../components/route-error"; |
| 5 | |
| 6 | /** |
| 7 | * Around the pages of a repository, a workspace and your settings |
| 8 | * (routes.ts): a page that fails shows its error where it would have been, |
| 9 | * inside its frame, so the header, tabs and sidebar its layout drew stay |
| 10 | * and the rest of g1t is a click away. Without it the error would replace |
| 11 | * the layout too, which a layout's own boundary does. |
| 12 | */ |
| 13 | export default function PageBoundary() { |
| 14 | return <Outlet />; |
| 15 | } |
| 16 | |
| 17 | export function ErrorBoundary({ error }: Route.ErrorBoundaryProps) { |
| 18 | return <RouteError error={error} contained />; |
| 19 | } |