{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "card-media-media-4-4",
  "type": "registry:block",
  "title": "Media library",
  "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/media-media-4-4.tsx",
      "type": "registry:component",
      "target": "components/overtrue/blocks/media-media-4-4.tsx",
      "content": "\"use client\";\nimport { BlockFrame } from \"./runtime/blocks/frame\";\nimport \"./runtime/cards.css\";\n// Extracted from src/components/overtrue/scenes/library.tsx:520.\nimport { useState } from \"react\";\nimport { SceneCard, Action } from \"./runtime/components/overtrue/scenes/shared\";\n\nfunction CardExample({\n  id = \"creative-review\",\n}: { id?: string } = {}) {\n  const [selected] = useState(0);\n  const [drafts, setDrafts] = useState<Record<number, string>>({});\n  const [notes, setNotes] = useState<Record<number, string[]>>({});\n  const note = drafts[selected] ?? \"\";\n  function addNote() {\n    if (!note.trim()) return;\n    setNotes((items) => ({\n      ...items,\n      [selected]: [...(items[selected] ?? []), note.trim()],\n    }));\n    setDrafts((items) => ({ ...items, [selected]: \"\" }));\n  }\n\n  return (\n    <>\n      <div className=\"overtrue-block-content\" data-workspace-page={id}>\n        <SceneCard title={`Feedback · ${notes[selected]?.length ?? 0}`}>\n          <form\n            className=\"scene-form\"\n            onSubmit={(e) => {\n              e.preventDefault();\n              addNote();\n            }}\n          >\n            <label>\n              Review note\n              <textarea\n                required\n                rows={4}\n                value={note}\n                onChange={(e) =>\n                  setDrafts((items) => ({\n                    ...items,\n                    [selected]: e.target.value,\n                  }))\n                }\n                placeholder=\"Describe the change and why it matters.\"\n              />\n            </label>\n            <Action type=\"submit\">Add note</Action>\n          </form>\n          <div className=\"scene-note-list\">\n            {(notes[selected] ?? []).map((item, i) => (\n              <div key={i}>\n                <p>{item}</p>\n                <small className=\"scene-subtle\">Maya Okafor · Just now</small>\n              </div>\n            ))}\n          </div>\n        </SceneCard>\n      </div>\n    </>\n  );\n}\n\nexport default function Block() { return <BlockFrame><CardExample /></BlockFrame>; }\n"
    }
  ],
  "docs": "Documentation: https://ui.overtrue.xyz/blocks/media-media-4-4. Includes the shared card foundation and hosted demo imagery. Replace sample data and navigation with your application data."
}
