{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "z-ai-message-item",
  "title": "Z Ai Message Item",
  "dependencies": [
    "@ai-sdk/react@3.0.102"
  ],
  "devDependencies": [],
  "registryDependencies": [
    "https://ui.orchid.ai/r/orchid-theme.json"
  ],
  "files": [
    {
      "path": "registry/ui/orchid/spectrum/atoms/z-ai-message-item/z-ai-message-item.tsx",
      "content": "\"use client\";\nimport { type UIMessage } from '@ai-sdk/react';\nexport default function ZAiMessageItem({ message }: {\n    message: UIMessage;\n}) {\n    const hasProp = <K extends string>(obj: unknown, key: K): obj is Record<K, unknown> => {\n        return typeof obj === 'object' && obj !== null && key in obj;\n    };\n    const rawText = hasProp(message, 'text') && typeof message.text === 'string'\n        ? (message.text as string)\n        : undefined;\n    const parts = hasProp(message, 'parts') && Array.isArray(message.parts)\n        ? (message.parts as Array<{\n            type: string;\n            text?: string;\n        }>)\n        : [];\n    const partsText = parts.map((p) => (p.type === 'text' ? (p.text ?? '') : '')).join('');\n    const reasoningText = parts\n        .filter((p) => (p as {\n        type: string;\n    }).type === 'reasoning')\n        .map((p) => (p as {\n        text?: string;\n    }).text ?? '')\n        .join('');\n    const baseText = rawText ?? partsText;\n    const visibleText = baseText;\n    const isUser = hasProp(message, 'role') && typeof message.role === 'string' && message.role === 'user';\n    return (<div className={isUser\n            ? 'bg-surface-subtle overflow-hidden rounded-xl p-0.5'\n            : 'overflow-hidden rounded-xl p-0.5'}>\n      <div className={isUser\n            ? 'bg-surface-subtle text-copy rounded-[10px] p-3 text-right shadow-sm'\n            : 'text-copy rounded-[10px] p-3'}>\n        <div className=\"text-neutral-subtle text-copy mb-2 font-medium\">\n          {isUser ? 'You' : 'Orchid'}\n        </div>\n        <div className=\"text-copy text-neutral leading-relaxed whitespace-pre-wrap\">\n          {visibleText.trim() || 'no message was sent'}\n        </div>\n        {reasoningText && (<details className=\"mt-3\">\n            <summary className=\"text-copy text-neutral-subtle hover:text-neutral cursor-pointer font-medium transition-colors\">\n              Reasoning\n            </summary>\n            <div className=\"text-copy text-neutral-subtle border-neutral-subtle/20 mt-2 border-l-2 pl-3 leading-relaxed whitespace-pre-wrap\">\n              {reasoningText}\n            </div>\n          </details>)}\n      </div>\n    </div>);\n}\n",
      "type": "registry:ui",
      "target": "@ui/orchid/spectrum/atoms/z-ai-message-item/z-ai-message-item.tsx"
    }
  ],
  "type": "registry:ui"
}