import { useNavigate, useRouter } from "@tanstack/react-router"; interface GenericErrorViewProps { error?: Error | unknown; resetErrorBoundary?: () => void; } const GenericErrorView = ({ error, resetErrorBoundary, }: GenericErrorViewProps) => { const router = useRouter(); const navigate = useNavigate(); const errorMessage = error instanceof Error ? error.message : "An unexpected system error occurred."; const handleTryAgain = async () => { if (resetErrorBoundary) { resetErrorBoundary(); } await router.invalidate(); const currentSearch = router.state.location.search; await navigate({ to: ".", search: currentSearch }); }; return (

Something went wrong

The application encountered an issue it couldn't recover from.

Error Logs: {errorMessage}
{resetErrorBoundary && ( )}
); }; export default GenericErrorView;