{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "audit-log-entry",
  "type": "registry:ui",
  "title": "Audit log entry",
  "description": "Single audit log line: actor avatar, actor name, muted action text and the affected target, with a relative timestamp underneath. Stacks into a trail.",
  "dependencies": [],
  "registryDependencies": [
    "https://ui.minidev.pro/r/avatar.json",
    "https://ui.minidev.pro/r/relative-time.json",
    "utils"
  ],
  "files": [
    {
      "path": "registry/ui/audit-log-entry.tsx",
      "type": "registry:ui",
      "target": "components/ui/audit-log-entry.tsx",
      "content": "\"use client\"\nimport * as React from \"react\"\nimport { cn } from \"@/lib/utils\"\nimport { RelativeTime } from \"@/components/ui/relative-time\"\nimport { Avatar, AvatarFallback } from \"@/components/ui/avatar\"\n\n/** One line of an audit log: who did what to which record, with a relative timestamp. */\ntype AuditLogEntryProps = {\n  actor?: string\n  action?: string\n  target?: string\n  /** When it happened. Defaults to about two hours ago. */\n  date?: string | Date\n  className?: string\n}\n\nconst SAMPLE_AGE_MS = 2 * 60 * 60 * 1000\n\nfunction AuditLogEntry({\n  actor = \"Priya Raman\",\n  action = \"archived invoice INV-2038 for Northwind\",\n  target,\n  date,\n  className,\n}: AuditLogEntryProps) {\n  const when = React.useMemo(() => date ?? new Date(Date.now() - SAMPLE_AGE_MS), [date])\n  return (\n    <div\n      data-slot=\"audit-log-entry\"\n      className={cn(\n        \"flex items-start gap-3 border-b border-border px-3 py-2.5 last:border-b-0\",\n        className\n      )}\n    >\n      <Avatar className=\"size-7\">\n        <AvatarFallback>{actor.slice(0, 2).toUpperCase()}</AvatarFallback>\n      </Avatar>\n      <div className=\"min-w-0 flex-1\">\n        <p className=\"text-sm text-fg\">\n          <span className=\"font-medium\">{actor}</span>{\" \"}\n          <span className=\"text-fg-muted\">{action}</span>\n          {target ? <> <span className=\"font-medium text-fg\">{target}</span></> : null}\n        </p>\n        <p className=\"mt-0.5 text-xs text-fg-muted\"><RelativeTime date={when} /></p>\n      </div>\n    </div>\n  )\n}\nexport { AuditLogEntry }\nexport type { AuditLogEntryProps }\n"
    }
  ]
}
