14 lines
346 B
TypeScript
14 lines
346 B
TypeScript
type SchemaProps = {
|
|
schema: Record<string, unknown> | Array<Record<string, unknown>>;
|
|
};
|
|
|
|
export function PageSchema({ schema }: SchemaProps) {
|
|
const payload = Array.isArray(schema) ? schema : [schema];
|
|
return (
|
|
<script
|
|
type="application/ld+json"
|
|
dangerouslySetInnerHTML={{ __html: JSON.stringify(payload) }}
|
|
/>
|
|
);
|
|
}
|