Statuses: Partial<
    {
        [K in StatusCode]: (
            result: RouteResult,
            span?: Span,
        ) =>
            | Route
            | Promise<Route>
            | Component<any>
            | { component: Component<any>; props?: Record<string, any> }
    },
>

Route status handler mapping.

Status handlers are called with a path and should return a new route or a promise that resolves to a new route.

const statuses: Statuses = {
[StatusCode.NotFound]: {
component: NotFound,
props: {
importantInfo: "lets go!"
}
},
[StatusCode.BadRequest]: (path) => {
notifySomething(path);
return {
component: BadRequest,
props: {
importantInfo: "something went wrong..."
}
};
}
}