-
Notifications
You must be signed in to change notification settings - Fork 7.9k
Expand file tree
/
Copy pathpage.tsx
More file actions
28 lines (24 loc) · 777 Bytes
/
page.tsx
File metadata and controls
28 lines (24 loc) · 777 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
import type {Metadata, ResolvingMetadata} from 'next';
import {fetchReactErrorCodes} from './[errorCode]/lib/fetch-error-codes';
import ErrorDecoderPage from './components/error-decoder-page';
export default async function ErrorPage() {
const errorCodes = await fetchReactErrorCodes();
return <ErrorDecoderPage errorCode={null} errorCodes={errorCodes} />;
}
export async function generateMetadata(
_: unknown,
parent?: ResolvingMetadata
): Promise<Metadata> {
const resolvedParent = await parent;
const parentOpenGraph = resolvedParent ? resolvedParent.openGraph : {};
return {
title: 'Minified Error Decoder',
alternates: {
canonical: `./`,
},
openGraph: {
...parentOpenGraph,
title: 'Minified Error Decoder',
},
};
}