{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "response-actions-demo",
  "title": "Response Actions Demo",
  "description": "A worked example of Response Actions: The row under an answer: copy it, ask again, and rate it. Drops into the actions slot on Message.",
  "registryDependencies": [
    "https://ui.tinkererslabs.com/r/response-actions.json"
  ],
  "files": [
    {
      "path": "components/demos/response-actions-demo.tsx",
      "content": "\"use client\"\n\nimport * as React from \"react\"\n\nimport { Message } from \"@/registry/default/message/message\"\nimport {\n  ResponseActions,\n  type ResponseFeedback,\n} from \"@/registry/default/response-actions/response-actions\"\n\nconst answer =\n  \"Rate limiting belongs in middleware so every route inherits it. Keep the counter in Redis with a sliding window, and return 429 with a Retry-After header once the window is full.\"\n\nexport function ResponseActionsDemo() {\n  const [feedback, setFeedback] = React.useState<ResponseFeedback>(null)\n  const [retries, setRetries] = React.useState(0)\n\n  return (\n    <div className=\"grid w-full max-w-xl gap-3\">\n      <Message\n        role=\"assistant\"\n        name=\"Mischief\"\n        actions={\n          <ResponseActions\n            copyText={answer}\n            feedback={feedback}\n            onFeedbackChange={setFeedback}\n            onRetry={() => setRetries((count) => count + 1)}\n          />\n        }\n      >\n        {answer}\n      </Message>\n\n      <p className=\"text-muted-foreground text-xs\" role=\"status\">\n        {feedback === null ? \"Not rated\" : `Rated ${feedback}`}\n        {retries > 0 ? ` · asked again ${retries}×` : \"\"}\n      </p>\n    </div>\n  )\n}\n",
      "type": "registry:example"
    }
  ],
  "type": "registry:example"
}