Files
myeasycms-v2/apps/web/app/not-found.tsx
giancarlo 0b374c558a Create legal pages and refactor navigation
New pages for Cookie Policy, Terms of Service, and Privacy Policy were added. The navigation system was restructured using a mapped array of links instead of hard coded components. The 'Not Found' page's metadata handling was improved and its translation was updated. Certain components that aid this refactoring were created and some pre-existing components or functions were moved to more appropriate locations or renamed for clarity. The Site Navigation, Footer, and Page header components were updated in layout and content. Various pages including Blog and Documentation were updated or removed.
2024-04-04 10:04:07 +08:00

72 lines
1.9 KiB
TypeScript

import Link from 'next/link';
import { ArrowLeft } from 'lucide-react';
import { getSupabaseServerComponentClient } from '@kit/supabase/server-component-client';
import { Button } from '@kit/ui/button';
import { Heading } from '@kit/ui/heading';
import { Trans } from '@kit/ui/trans';
import { SiteHeader } from '~/(marketing)/_components/site-header';
import { createI18nServerInstance } from '~/lib/i18n/i18n.server';
import { withI18n } from '~/lib/i18n/with-i18n';
export const generateMetadata = async () => {
const i18n = await createI18nServerInstance();
const title = i18n.t('common:notFound');
return {
title,
};
};
const NotFoundPage = async () => {
const client = getSupabaseServerComponentClient();
const {
data: { user },
} = await client.auth.getUser();
return (
<div className={'flex h-screen flex-1 flex-col'}>
<SiteHeader user={user} />
<div
className={
'm-auto flex w-full flex-1 flex-col items-center justify-center'
}
>
<div className={'flex flex-col items-center space-y-12'}>
<div>
<h1 className={'text-8xl font-extrabold'}>404 :(</h1>
</div>
<div className={'flex flex-col items-center space-y-4'}>
<div className={'flex flex-col items-center space-y-2.5'}>
<div>
<Heading level={1}>
<Trans i18nKey={'common:pageNotFound'} />
</Heading>
</div>
<p className={'text-muted-foreground'}>
<Trans i18nKey={'common:pageNotFoundSubHeading'} />
</p>
</div>
<Link href={'/'}>
<Button variant={'outline'}>
<ArrowLeft className={'mr-2 h-4'} />
<Trans i18nKey={'common:backToHomePage'} />
</Button>
</Link>
</div>
</div>
</div>
</div>
);
};
export default withI18n(NotFoundPage);