/**
 * Renders a JSON-LD `<script type="application/ld+json">` tag with the given
 * schema payload. Use for Article, MedicalCondition, ResearchProject, and
 * other schema.org vocabularies. Safe for use in server components.
 *
 * Intentionally keeps the payload inline rather than shipping a dependency —
 * Google's structured-data tester reads whatever is in the DOM.
 */
export function JsonLd({ data }: { data: unknown }) {
  return (
    <script
      type="application/ld+json"
      // eslint-disable-next-line react/no-danger
      dangerouslySetInnerHTML={{
        __html: JSON.stringify(data).replace(/</g, "\\u003c"),
      }}
    />
  );
}
