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

16 lines
387 B
TypeScript

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
async
src={`https://pagead2.googlesyndication.com/pagead/js/adsbygoogle.js?client=${encodeURIComponent(clientId)}`}
crossOrigin="anonymous"
/>
);
}