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) }}
    />
  );
}
