1import Link from 'next/link'
2import { useEffect } from 'react'
3
4export default function NotFound() {
5  useEffect(() => {
6    if (
7      typeof window !== 'undefined' &&
8      typeof window?.analytics?.track === 'function' &&
9      typeof window?.document?.referrer === 'string' &&
10      typeof window?.location?.href === 'string'
11    )
12      window.analytics.track(window.location.href, {
13        category: '404 Response',
14        label: window.document.referrer || 'No Referrer',
15      })
16  }, [])
17
18  return (
19    <div id="p-404">
20      <h1>Page Not Found</h1>
21      <p>
22        We&lsquo;re sorry but we can&lsquo;t find the page you&lsquo;re looking
23        for.
24      </p>
25      <p>
26        <Link href="/">
27          <a>Back to Home</a>
28        </Link>
29      </p>
30    </div>
31  )
32}
33