Files
buzz-sheet/components/public/google-adsense.tsx
T

19 lines
464 B
TypeScript

import Script from "next/script";
const clientId = process.env.NEXT_PUBLIC_GOOGLE_ADSENSE_CLIENT_ID?.trim();
export function GoogleAdsense() {
if (process.env.NODE_ENV !== "production" || !clientId) {
return null;
}
return (
<Script
id="google-adsense"
src={`https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=${encodeURIComponent(clientId)}`}
strategy="lazyOnload"
crossOrigin="anonymous"
/>
);
}