diff --git a/src/app/layout.tsx b/src/app/layout.tsx index dd51132..563897b 100644 --- a/src/app/layout.tsx +++ b/src/app/layout.tsx @@ -10,6 +10,7 @@ import { siteMetadata } from "@/data/siteMetadata"; import Head from "./head"; import { GoogleAnalytics } from "@next/third-parties/google"; import { ENV } from "@/lib/env"; +import { GoogleAdsense } from "@/components/google-adsense"; const space_grotesk = Space_Grotesk({ subsets: ["latin"], @@ -79,6 +80,7 @@ export default function RootLayout({ + ); diff --git a/src/components/google-adsense.tsx b/src/components/google-adsense.tsx new file mode 100644 index 0000000..057103c --- /dev/null +++ b/src/components/google-adsense.tsx @@ -0,0 +1,17 @@ +import { ENV } from "@/lib/env"; +import Script from "next/script"; + +export const GoogleAdsense = ({ pId }: { pId: string }) => { + if (process.env.NODE_ENV !== "production") { + return null; + } + + return ( +