/**
 * Renders one or more JSON-LD schema objects as <script type="application/ld+json">.
 * Schema is built server-side from our own data, so inlining is safe.
 */
export default function JsonLd({ schema }) {
  const items = (Array.isArray(schema) ? schema : [schema]).filter(Boolean);
  return (
    <>
      {items.map((item, i) => (
        <script
          key={i}
          type="application/ld+json"
          dangerouslySetInnerHTML={{ __html: JSON.stringify(item) }}
        />
      ))}
    </>
  );
}
