json
This commit is contained in:
16
components/JsonLd.tsx
Normal file
16
components/JsonLd.tsx
Normal file
@@ -0,0 +1,16 @@
|
||||
import Script from 'next/script';
|
||||
|
||||
interface JsonLdProps {
|
||||
id?: string;
|
||||
data: any;
|
||||
}
|
||||
|
||||
export default function JsonLd({ id, data }: JsonLdProps) {
|
||||
return (
|
||||
<Script
|
||||
id={id || `jsonld-${Math.random().toString(36).substr(2, 9)}`}
|
||||
type="application/ld+json"
|
||||
dangerouslySetInnerHTML={{ __html: JSON.stringify(data) }}
|
||||
/>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user