logicsrc/apps/logicsrc-web/src/components/ad-unit.tsx
Anthony Ettinger d76dd498f2
Some checks failed
CI / build (push) Has been cancelled
test / test (push) Has been cancelled
feat(web): add CrawlProof ad unit to /blog/*
Reusable AdUnit component (div[data-cp-ad] + ad.js via next/script) placed
in-content on the blog index and post pages, scoped to /blog/* only.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-07-08 10:40:04 +00:00

20 lines
573 B
TypeScript

import type { ReactNode } from "react";
import Script from "next/script";
// CrawlProof ad unit, scoped to the pages that render it (currently /blog/*).
// The loader is deduped by src, so mounting <AdUnit /> on multiple routes only
// injects one https://crawlproof.com/ad.js.
export function AdUnit({
slot,
format = "banner_300x250",
}: {
slot: string;
format?: string;
}): ReactNode {
return (
<>
<div data-cp-ad data-slot={slot} data-format={format} />
<Script src="https://crawlproof.com/ad.js" strategy="afterInteractive" />
</>
);
}