{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "elements-draft-restore",
  "type": "registry:component",
  "title": "Draft restore",
  "description": "Come back to a thread and the sentence you never sent is still waiting.",
  "registryDependencies": [
    "https://r.assistant-ui.com/elements-surfaces.json"
  ],
  "dependencies": [
    "lucide-react"
  ],
  "files": [
    {
      "type": "registry:component",
      "path": "components/assistant-ui/elements/draft-restore.tsx",
      "content": "\"use client\";\n\nimport type { ComponentProps } from \"react\";\nimport { PencilLineIcon, XIcon } from \"lucide-react\";\nimport { cn } from \"@/lib/utils\";\nimport { ghostButton, mono, paper } from \"./surfaces\";\n\nexport function DraftRestore({\n  draft,\n  savedAt,\n  onRestore,\n  onDiscard,\n  className,\n  ...props\n}: Omit<\n  ComponentProps<\"div\">,\n  \"children\" | \"draft\" | \"savedAt\" | \"onRestore\" | \"onDiscard\"\n> & {\n  draft: string;\n  savedAt: string;\n  onRestore?: () => void;\n  onDiscard?: () => void;\n}) {\n  return (\n    <div\n      data-slot=\"draft-restore\"\n      className={cn(\n        paper,\n        \"fade-in slide-in-from-bottom-1 animate-in flex w-full max-w-sm items-center gap-2.5 rounded-2xl py-2 pr-2 pl-3.5 duration-300\",\n        className,\n      )}\n\n      {...props}\n    >\n      <PencilLineIcon className=\"text-foreground/30 size-3.5 shrink-0\" />\n      <div className=\"flex min-w-0 flex-1 flex-col\">\n        <span className=\"text-foreground/70 truncate text-[13px]\">{draft}</span>\n        <span className={cn(mono, \"text-foreground/30\")}>\n          unsent draft · {savedAt}\n        </span>\n      </div>\n      <button\n        type=\"button\"\n        onClick={onRestore}\n        className=\"text-foreground/70 hover:bg-foreground/[0.06] hover:text-foreground/95 shrink-0 rounded-full px-2.5 py-1 text-xs font-medium transition-[background-color,color,scale] duration-150 active:scale-[0.96]\"\n      >\n        Restore\n      </button>\n      <button\n        type=\"button\"\n        aria-label=\"Discard the draft\"\n        onClick={onDiscard}\n        className={cn(ghostButton, \"size-7 shrink-0\")}\n      >\n        <XIcon className=\"size-3.5\" />\n      </button>\n    </div>\n  );\n}\n"
    }
  ]
}