{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "ai-disclaimer",
  "title": "AI disclaimer",
  "description": "Marks content as AI-generated: the model, when it ran, and whether a clinician has reviewed it.",
  "dependencies": [
    "cn@^0.5.0"
  ],
  "registryDependencies": [
    "alert"
  ],
  "files": [
    {
      "path": "registry/base-nova/ai-disclaimer/ai-disclaimer.tsx",
      "content": "import * as React from \"react\"\n\nimport { Alert, AlertDescription, AlertTitle } from \"@/components/ui/alert\"\nimport { IconPlaceholder } from \"@/icons/icon-placeholder\"\n\nexport type AiReview = {\n  /** The reviewer's name, as your record shows it. */\n  by: string\n  /** An ISO 8601 date-time. */\n  at: string\n  /** The decision, as ClinicianReview records it. Defaults to approved. */\n  status?: \"approved\" | \"changes-requested\" | \"rejected\"\n}\n\nexport type AiDisclaimerProps = React.ComponentProps<\"div\"> & {\n  /** The model or service that produced the content. */\n  model?: string\n  /** When it was generated, an ISO 8601 date-time. */\n  generatedAt?: string\n  /** Who reviewed it and when, once someone has; the title and text then say so. */\n  review?: AiReview | null\n  /** Replaces the default guidance. */\n  children?: React.ReactNode\n  /** Defaults to a UTC date and time such as \"Oct 21, 2026, 9:30 AM UTC\". */\n  formatDate?: (date: string) => string\n}\n\nconst reviewText = {\n  approved: { title: \"AI-generated, reviewed\", by: \"Reviewed by\" },\n  \"changes-requested\": {\n    title: \"AI-generated, changes requested\",\n    by: \"Changes requested by\",\n  },\n  rejected: { title: \"AI-generated, rejected\", by: \"Rejected by\" },\n}\n\nconst dateFormat = new Intl.DateTimeFormat(\"en-US\", {\n  dateStyle: \"medium\",\n  timeStyle: \"short\",\n  timeZone: \"UTC\",\n})\n\n// A fixed locale and time zone render the same on the server and the client.\nfunction defaultFormatDate(date: string) {\n  const time = Date.parse(date)\n  return Number.isNaN(time) ? date : `${dateFormat.format(time)} UTC`\n}\n\n/**\n * Marks content as AI-generated: what produced it, when, and whether a\n * clinician has reviewed it. Place it above the content it describes.\n */\nexport function AiDisclaimer({\n  model,\n  generatedAt,\n  review = null,\n  children,\n  formatDate = defaultFormatDate,\n  className,\n  ...props\n}: AiDisclaimerProps) {\n  const text = review && reviewText[review.status ?? \"approved\"]\n  const source = [\n    model,\n    generatedAt && `generated ${formatDate(generatedAt)}`,\n  ].filter(Boolean)\n  return (\n    // A note, not an alert: it describes the content without interrupting.\n    <Alert\n      data-slot=\"ai-disclaimer\"\n      role=\"note\"\n      className={className}\n      {...props}\n    >\n      <IconPlaceholder\n        lucide=\"SparklesIcon\"\n        tabler=\"IconSparkles\"\n        hugeicons=\"SparklesIcon\"\n        phosphor=\"SparkleIcon\"\n        remixicon=\"RiSparklingLine\"\n        aria-hidden=\"true\"\n      />\n      <AlertTitle>{text ? text.title : \"AI-generated draft\"}</AlertTitle>\n      <AlertDescription>\n        <p>\n          {children ??\n            (review && text\n              ? `${text.by} ${review.by}, ${formatDate(review.at)}.${review.status && review.status !== \"approved\" ? \" Don't rely on it until it is revised and approved.\" : \"\"}`\n              : \"Not yet reviewed by a clinician. Check it against the record before you rely on it; it is not a diagnosis.\")}\n        </p>\n        {source.length > 0 && (\n          <p className=\"text-xs text-muted-foreground\">{source.join(\" · \")}</p>\n        )}\n      </AlertDescription>\n    </Alert>\n  )\n}\n",
      "type": "registry:ui"
    }
  ],
  "docs": "AI disclaimer docs: https://organui.com/docs/ai-elements/ai-disclaimer",
  "categories": [
    "ai"
  ],
  "type": "registry:ui"
}