{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "card-client-feedback-out-of-5-1",
  "type": "registry:block",
  "title": "out of 5",
  "description": "Workspace card from the overtrue/ui workspace examples. Editable source, scoped styles, and demo interactions.",
  "categories": [
    "cards",
    "workspace"
  ],
  "registryDependencies": [
    "https://ui.overtrue.xyz/r/overtrue-card-foundation.json"
  ],
  "files": [
    {
      "path": "src/blocks/registry/client-feedback-out-of-5-1.tsx",
      "type": "registry:component",
      "target": "components/overtrue/blocks/client-feedback-out-of-5-1.tsx",
      "content": "\"use client\";\nimport { BlockFrame } from \"./runtime/blocks/frame\";\nimport \"./runtime/cards.css\";\n// Extracted from src/components/overtrue/scenes/content-workbench.tsx:503.\nimport { useState } from \"react\";\nimport { IconCheck, IconStar } from \"@tabler/icons-react\";\nimport { SceneCard, Action } from \"./runtime/components/overtrue/scenes/shared\";\n\nfunction CardExample() {\n  const [rating, setRating] = useState(0);\n  const [comment, setComment] = useState(\"\");\n  const [submitted, setSubmitted] = useState(false);\n\n  return (\n    <>\n      <div\n        className=\"overtrue-block-content\"\n        data-workspace-page=\"stars-rating\"\n      >\n        <SceneCard\n          title={\n            submitted ? \"Thank you for the feedback\" : \"How did the project go?\"\n          }\n          description=\"Share your experience with the delivery team.\"\n        >\n          {submitted ? (\n            <div className=\"scene-feedback-result\">\n              <IconCheck size={32} />\n              <h3>{rating} out of 5</h3>\n              <p>{comment || \"No additional comments.\"}</p>\n              <Action onClick={() => setSubmitted(false)}>Edit feedback</Action>\n            </div>\n          ) : (\n            <form\n              className=\"scene-form\"\n              onSubmit={(e) => {\n                e.preventDefault();\n                if (rating) setSubmitted(true);\n              }}\n            >\n              <fieldset className=\"scene-rating\">\n                <legend>Overall experience</legend>\n                {[1, 2, 3, 4, 5].map((value) => (\n                  <label key={value}>\n                    <input\n                      type=\"radio\"\n                      name=\"rating\"\n                      required\n                      value={value}\n                      checked={rating === value}\n                      onChange={() => setRating(value)}\n                    />\n                    <IconStar\n                      size={32}\n                      fill={value <= rating ? \"currentColor\" : \"none\"}\n                    />\n                    <span className=\"sr-only\">\n                      {value} {value === 1 ? \"star\" : \"stars\"}\n                    </span>\n                  </label>\n                ))}\n              </fieldset>\n              <label>\n                What worked well? What could be better?\n                <textarea\n                  rows={5}\n                  value={comment}\n                  onChange={(e) => setComment(e.target.value)}\n                  placeholder=\"Your feedback helps us improve the next project.\"\n                />\n              </label>\n              <Action type=\"submit\" primary>\n                Submit feedback\n              </Action>\n              <small>Feedback is saved only in this preview.</small>\n            </form>\n          )}\n        </SceneCard>\n      </div>\n    </>\n  );\n}\n\nexport default function Block() { return <BlockFrame><CardExample /></BlockFrame>; }\n"
    }
  ],
  "docs": "Documentation: https://ui.overtrue.xyz/blocks/client-feedback-out-of-5-1. Includes the shared card foundation and hosted demo imagery. Replace sample data and navigation with your application data."
}
