- Updated application version from 2.23.13 to 2.23.14 in package.json. - Refactored error handling components in web app to utilize a new ErrorPageContent component for improved code organization and readability. - Simplified error and not found page layouts by removing redundant code and enhancing localization keys for better user experience.
49 lines
1.1 KiB
TypeScript
49 lines
1.1 KiB
TypeScript
'use client';
|
|
|
|
import { useCaptureException } from '@kit/monitoring/hooks';
|
|
import { useUser } from '@kit/supabase/hooks/use-user';
|
|
|
|
import { SiteHeader } from '~/(marketing)/_components/site-header';
|
|
import { ErrorPageContent } from '~/components/error-page-content';
|
|
import { RootProviders } from '~/components/root-providers';
|
|
|
|
const GlobalErrorPage = ({
|
|
error,
|
|
reset,
|
|
}: {
|
|
error: Error & { digest?: string };
|
|
reset: () => void;
|
|
}) => {
|
|
useCaptureException(error);
|
|
|
|
return (
|
|
<html lang="en">
|
|
<body>
|
|
<RootProviders>
|
|
<GlobalErrorContent reset={reset} />
|
|
</RootProviders>
|
|
</body>
|
|
</html>
|
|
);
|
|
};
|
|
|
|
function GlobalErrorContent({ reset }: { reset: () => void }) {
|
|
const user = useUser();
|
|
|
|
return (
|
|
<div className={'flex h-screen flex-1 flex-col'}>
|
|
<SiteHeader user={user.data} />
|
|
|
|
<ErrorPageContent
|
|
statusCode={'common:errorPageHeading'}
|
|
heading={'common:genericError'}
|
|
subtitle={'common:genericErrorSubHeading'}
|
|
backLabel={'common:goBack'}
|
|
reset={reset}
|
|
/>
|
|
</div>
|
|
);
|
|
}
|
|
|
|
export default GlobalErrorPage;
|