diff --git a/src/components/seo/JsonLd.tsx b/src/components/seo/JsonLd.tsx new file mode 100644 index 0000000..4af447c --- /dev/null +++ b/src/components/seo/JsonLd.tsx @@ -0,0 +1,39 @@ +import Script from 'next/script'; +import { SchemaType } from '@/lib/seo/schema/types'; + +interface JsonLdProps { + data: SchemaType | SchemaType[]; +} + +/** + * React component to render JSON-LD schema markup + * Uses Next.js Script component for proper loading + * + * @param data - Single schema object or array of schemas + * @returns Script component with JSON-LD + * @example + * + * + */ +export function JsonLd({ data }: JsonLdProps) { + // Handle single schema or array + const schemas = Array.isArray(data) ? data : [data]; + + return ( + <> + {schemas.map((schema, index) => ( +