14 lines
399 B
TypeScript
14 lines
399 B
TypeScript
import { headers } from "next/headers";
|
|
import { serializeStructuredData } from "@/lib/marketing/seo";
|
|
|
|
export async function StructuredData({ data }: { data: unknown }) {
|
|
const nonce = (await headers()).get("x-nonce") ?? undefined;
|
|
return (
|
|
<script
|
|
type="application/ld+json"
|
|
nonce={nonce}
|
|
dangerouslySetInnerHTML={{ __html: serializeStructuredData(data) }}
|
|
/>
|
|
);
|
|
}
|