Files
nextjs-notion-starter-kit/components/Page404.tsx
2021-01-15 11:31:09 -05:00

49 lines
1.1 KiB
TypeScript

import Head from 'next/head'
import * as React from 'react'
import * as types from 'lib/types'
import { defaultSiteFavicon } from 'lib/config'
import { PageHead } from './PageHead'
import styles from './styles.module.css'
export const Page404: React.FC<types.PageProps> = ({ site, pageId, error }) => {
const title = site?.name || 'Notion Page Not Found'
return (
<>
<PageHead site={site} />
<Head>
<link rel='shortcut icon' href={defaultSiteFavicon} />
<meta property='og:site_name' content={title} />
<meta property='og:title' content={title} />
<title>{title}</title>
</Head>
<div className={styles.container}>
<main className={styles.main}>
<h1>Notion Page Not Found</h1>
{error ? (
<p>{error.message}</p>
) : (
pageId && (
<p>
Make sure that Notion page "{pageId}" is publicly accessible.
</p>
)
)}
<img
src='/404.png'
alt='404 Not Found'
className={styles.errorImage}
/>
</main>
</div>
</>
)
}