import type { SourceTrustMetadata } from "@paperclipai/shared"; import { BadgeCheck, ShieldAlert } from "lucide-react"; import { Badge } from "@/components/ui/badge"; import { Tooltip, TooltipContent, TooltipTrigger } from "@/components/ui/tooltip"; import { sourceTrustLabel } from "../lib/trust-policy-ui"; import { cn } from "../lib/utils"; export function SourceTrustBadge({ sourceTrust, artifactLabel = "content", className, }: { sourceTrust: SourceTrustMetadata | null | undefined; artifactLabel?: "comment" | "document" | "work product" | "content"; className?: string; }) { const label = sourceTrustLabel(sourceTrust); if (!label) return null; const promoted = sourceTrust?.disposition === "promoted"; const tooltip = promoted ? `Promoted from low-trust${sourceTrust.promotedAt ? ` on ${new Date(sourceTrust.promotedAt).toLocaleString()}` : ""}.` : `Authored by a low-trust review agent. Raw ${artifactLabel} is not auto-shared with higher-trust agents.`; return ( {promoted ? : } {label} {tooltip} ); }