Version 3 of the kit: - Radix UI replaced with Base UI (using the Shadcn UI patterns) - next-intl replaces react-i18next - enhanceAction deprecated; usage moved to next-safe-action - main layout now wrapped with [locale] path segment - Teams only mode - Layout updates - Zod v4 - Next.js 16.2 - Typescript 6 - All other dependencies updated - Removed deprecated Edge CSRF - Dynamic Github Action runner
44 lines
1.2 KiB
TypeScript
44 lines
1.2 KiB
TypeScript
import { cookies } from 'next/headers';
|
|
|
|
import { getMessages, getTranslations } from 'next-intl/server';
|
|
|
|
import { routing } from '@kit/i18n';
|
|
import { I18nClientProvider } from '@kit/i18n/provider';
|
|
|
|
import { ErrorPageContent } from '~/components/error-page-content';
|
|
import { getRootTheme } from '~/lib/root-theme';
|
|
|
|
export const generateMetadata = async () => {
|
|
const t = await getTranslations('common');
|
|
const title = t('notFound');
|
|
|
|
return {
|
|
title,
|
|
};
|
|
};
|
|
|
|
const NotFoundPage = async () => {
|
|
const theme = await getRootTheme();
|
|
const cookieStore = await cookies();
|
|
const locale = cookieStore.get('lang')?.value || routing.defaultLocale;
|
|
const messages = await getMessages({ locale });
|
|
|
|
return (
|
|
<html lang="en" className={theme}>
|
|
<body className="bg-background">
|
|
<div className={'flex h-screen flex-1 flex-col'}>
|
|
<I18nClientProvider locale={locale} messages={messages}>
|
|
<ErrorPageContent
|
|
statusCode={'common.pageNotFoundHeading'}
|
|
heading={'common.pageNotFound'}
|
|
subtitle={'common.pageNotFoundSubHeading'}
|
|
/>
|
|
</I18nClientProvider>
|
|
</div>
|
|
</body>
|
|
</html>
|
|
);
|
|
};
|
|
|
|
export default NotFoundPage;
|