{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "prompt-input-demo",
  "title": "Prompt Input Demo",
  "description": "A worked example of Prompt Input: The composer. Grows with the message, sends on Enter, keeps Shift+Enter for a new line, and turns into a stop button while a reply streams.",
  "registryDependencies": [
    "https://ui.tinkererslabs.com/r/prompt-input.json"
  ],
  "files": [
    {
      "path": "components/demos/prompt-input-demo.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\n\nimport { PromptInput } from \"@/registry/default/prompt-input/prompt-input\"\n\nexport function PromptInputDemo() {\n  const [sent, setSent] = React.useState<string | null>(null)\n  const [status, setStatus] = React.useState<\"ready\" | \"streaming\">(\"ready\")\n\n  React.useEffect(() => {\n    if (status !== \"streaming\") return\n\n    const timer = window.setTimeout(() => setStatus(\"ready\"), 2600)\n    return () => window.clearTimeout(timer)\n  }, [status])\n\n  return (\n    <div className=\"grid w-full max-w-xl gap-3\">\n      <PromptInput\n        status={status}\n        onSubmit={(value) => {\n          setSent(value)\n          setStatus(\"streaming\")\n        }}\n        onStop={() => setStatus(\"ready\")}\n      />\n\n      <p className=\"text-muted-foreground text-center text-xs\">\n        {status === \"streaming\"\n          ? \"Replying… press stop to cancel.\"\n          : sent\n            ? `Sent: ${sent}`\n            : \"Enter sends. Shift+Enter starts a new line.\"}\n      </p>\n    </div>\n  )\n}\n",
      "type": "registry:example"
    }
  ],
  "type": "registry:example"
}