diff --git a/app/_app.tsx b/app/_app.tsx new file mode 100644 index 0000000..fd3af13 --- /dev/null +++ b/app/_app.tsx @@ -0,0 +1,45 @@ +import { useEffect } from 'react'; +import Script from 'next/script'; +import type { AppProps } from 'next/app'; +import '../styles/globals.css'; + +// Add a TypeScript declaration for the clarity property on the window object +declare global { + interface Window { + clarity: (...args: any[]) => void; + } +} + +function MyApp({ Component, pageProps }: AppProps) { + useEffect(() => { + // Initialize Clarity + if (typeof window !== 'undefined') { + window.clarity = window.clarity || function () { + (window.clarity as any).q = (window.clarity as any).q || []; + (window.clarity as any).q.push(arguments); + }; + window.clarity('set', 'projectId', 'qkmypl9uld'); + } + }, []); + + return ( + <> +