diff --git a/src/theme/NotFound/Content/index.tsx b/src/theme/NotFound/Content/index.tsx new file mode 100644 index 000000000..798a20646 --- /dev/null +++ b/src/theme/NotFound/Content/index.tsx @@ -0,0 +1,53 @@ +import React, { useEffect } from 'react'; +import clsx from 'clsx'; +import Translate from '@docusaurus/Translate'; +import type {Props} from '@theme/NotFound/Content'; +import Heading from '@theme/Heading'; + +declare const Statsig: { + instance: () => { + logEvent: (eventName: string, value: string) => void; + }; +}; + +export default function NotFoundContent({className}: Props): JSX.Element { + useEffect(() => { + console.log("NotFoundWrapper useEffect is running"); // Add this line + try { + Statsig.instance().logEvent('PageNotFound', window.location.href); + console.log("Successfully logged PageNotFound event"); + } catch (error) { + console.error("Error logging PageNotFound event:", error); + } + }, []); + return ( +
+
+
+ + + Page Not Found + + +

+ + We could not find what you were looking for. + +

+

+ + Please contact the owner of the site that linked you to the + original URL and let them know their link is broken. + +

+
+
+
+ ); +} diff --git a/src/theme/NotFound/index.tsx b/src/theme/NotFound/index.tsx index 7a57aef7d..9eb661dd6 100644 --- a/src/theme/NotFound/index.tsx +++ b/src/theme/NotFound/index.tsx @@ -1,14 +1,21 @@ -import React, { useEffect } from 'react'; -import NotFound from '@theme-original/NotFound'; -import type NotFoundType from '@theme/NotFound'; -import type {WrapperProps} from '@docusaurus/types'; +import React from 'react'; +import {translate} from '@docusaurus/Translate'; +import {PageMetadata} from '@docusaurus/theme-common'; +import Layout from '@theme/Layout'; +import NotFoundContent from '@theme/NotFound/Content'; -type Props = WrapperProps; - -export default function NotFoundWrapper(props: Props): JSX.Element { +export default function Index(): JSX.Element { + + const title = translate({ + id: 'theme.NotFound.title', + message: 'Page Not Found', + }); return ( <> - + + + + ); }