{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "message",
  "title": "Message",
  "description": "One turn in a thread, with role, avatar, timestamp, and reachable actions.",
  "registryDependencies": [
    "utils"
  ],
  "files": [
    {
      "path": "registry/default/message/message.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\nimport { cn } from \"@/lib/utils\"\n\nexport type MessageRole = \"user\" | \"assistant\" | \"system\"\n\nexport type MessageProps = React.HTMLAttributes<HTMLElement> & {\n  role: MessageRole\n  name?: React.ReactNode\n  avatar?: React.ReactNode\n  timestamp?: React.ReactNode\n  actions?: React.ReactNode\n  pending?: boolean\n}\n\nconst roleName: Record<MessageRole, string> = {\n  user: \"You\",\n  assistant: \"Assistant\",\n  system: \"System\",\n}\n\nexport function Message({\n  role,\n  name,\n  avatar,\n  timestamp,\n  actions,\n  pending = false,\n  children,\n  className,\n  ...rootProps\n}: MessageProps) {\n  const label = name ?? roleName[role]\n\n  return (\n    <article\n      data-slot=\"message\"\n      data-role={role}\n      aria-busy={pending || undefined}\n      className={cn(\n        \"group/message flex gap-3 px-1 py-3\",\n        role === \"user\" && \"flex-row-reverse\",\n        className\n      )}\n      {...rootProps}\n    >\n      {avatar ? (\n        <span\n          aria-hidden=\"true\"\n          data-slot=\"message-avatar\"\n          className=\"bg-muted text-muted-foreground mt-0.5 flex size-7 shrink-0 items-center justify-center overflow-hidden rounded-full text-xs font-semibold [&>img]:size-full [&>img]:object-cover\"\n        >\n          {avatar}\n        </span>\n      ) : null}\n\n      <div\n        className={cn(\n          \"flex min-w-0 flex-col gap-1\",\n          role === \"user\" ? \"items-end\" : \"items-start\"\n        )}\n      >\n        <p className=\"sr-only\">{label}</p>\n\n        <div\n          data-slot=\"message-body\"\n          className={cn(\n            \"max-w-[42rem] min-w-0 text-sm leading-relaxed\",\n            role === \"user\" &&\n              \"bg-muted rounded-2xl rounded-tr-sm px-3.5 py-2.5 text-left\",\n            role === \"system\" && \"text-muted-foreground italic\"\n          )}\n        >\n          {children}\n        </div>\n\n        {timestamp || actions ? (\n          <div\n            data-slot=\"message-meta\"\n            className=\"text-muted-foreground flex items-center gap-2 text-xs\"\n          >\n            {timestamp ? <span>{timestamp}</span> : null}\n            {actions ? (\n              <span\n                data-slot=\"message-actions\"\n                className=\"opacity-0 transition-opacity duration-150 group-focus-within/message:opacity-100 group-hover/message:opacity-100 motion-reduce:transition-none [@media(hover:none)]:opacity-100\"\n              >\n                {actions}\n              </span>\n            ) : null}\n          </div>\n        ) : null}\n      </div>\n    </article>\n  )\n}\n",
      "type": "registry:ui"
    }
  ],
  "categories": [
    "ai",
    "chat",
    "message",
    "agent"
  ],
  "type": "registry:ui"
}