buildmymcpserver/apps/web/components/json-ld.tsx

14 lines
470 B
TypeScript
Raw Permalink Normal View History

// Renders a JSON-LD structured-data script. The `<` escape prevents a
// `</script>` sequence in the data from breaking out of the tag.
export function JsonLd({ data }: { data: object }) {
return (
<script
type="application/ld+json"
// biome-ignore lint/security/noDangerouslySetInnerHtml: JSON-LD must be injected as a raw script.
dangerouslySetInnerHTML={{
__html: JSON.stringify(data).replace(/</g, '\\u003c'),
}}
/>
);
}