{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "card-emails-template-settings-1",
  "type": "registry:block",
  "title": "Template settings",
  "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/emails-template-settings-1.tsx",
      "type": "registry:component",
      "target": "components/overtrue/blocks/emails-template-settings-1.tsx",
      "content": "\"use client\";\nimport { BlockFrame } from \"./runtime/blocks/frame\";\nimport \"./runtime/cards.css\";\n// Extracted from src/components/overtrue/scenes/communication.tsx:445.\nimport { useState } from \"react\";\nimport { SceneCard } from \"./runtime/components/overtrue/scenes/shared\";\n\nfunction CardExample() {\n  const templates = [\n    {\n      id: \"review\",\n      name: \"Review request\",\n      subject: \"Visitor concepts are ready for review\",\n      body: \"The latest concepts are ready. Please review the visual direction and leave feedback before September 25.\",\n    },\n    {\n      id: \"invite\",\n      name: \"Project invitation\",\n      subject: \"You’ve been invited to Visitor experience\",\n      body: \"Maya invited you to join the project. Open the workspace to see the brief, meet the team, and review the next deliverables.\",\n    },\n    {\n      id: \"digest\",\n      name: \"Weekly digest\",\n      subject: \"This week at Acme Studio\",\n      body: \"Two deliverables are ready for review. The Visitor concepts are awaiting feedback, and the identity handover is prepared for approval.\",\n    },\n  ];\n  const [selected, setSelected] = useState(\"review\");\n  const [drafts, setDrafts] = useState<\n    Record<string, { subject: string; body: string }>\n  >({});\n  const [recipient, setRecipient] = useState(\"alex@client.example\");\n  const template = templates.find((item) => item.id === selected)!;\n  const draft = drafts[selected] ?? template;\n  const setDraft = (patch: Partial<{ subject: string; body: string }>) =>\n    setDrafts((items) => ({\n      ...items,\n      [selected]: { subject: draft.subject, body: draft.body, ...patch },\n    }));\n\n  return (\n    <>\n      <div className=\"overtrue-block-content\" data-workspace-page=\"emails\">\n        <SceneCard title=\"Template settings\">\n          <form className=\"scene-form\" onSubmit={(e) => e.preventDefault()}>\n            <label>\n              Template\n              <select\n                value={selected}\n                onChange={(e) => setSelected(e.target.value)}\n              >\n                {templates.map((item) => (\n                  <option value={item.id} key={item.id}>\n                    {item.name}\n                  </option>\n                ))}\n              </select>\n            </label>\n            <label>\n              Preview recipient\n              <input\n                type=\"email\"\n                value={recipient}\n                onChange={(e) => setRecipient(e.target.value)}\n              />\n            </label>\n            <label>\n              Subject\n              <input\n                value={draft.subject}\n                onChange={(e) => setDraft({ subject: e.target.value })}\n              />\n            </label>\n            <label>\n              Message\n              <textarea\n                rows={6}\n                value={draft.body}\n                onChange={(e) => setDraft({ body: e.target.value })}\n              />\n            </label>\n            <a\n              className=\"scene-button\"\n              href={`data:text/plain;charset=utf-8,${encodeURIComponent(`Subject: ${draft.subject}\\nTo: ${recipient}\\n\\n${draft.body}\\n\\nAcme Studio`)}`}\n              download={`${selected}-template.txt`}\n            >\n              Download template\n            </a>\n            <small>This preview does not send email.</small>\n          </form>\n        </SceneCard>\n      </div>\n    </>\n  );\n}\n\nexport default function Block() { return <BlockFrame><CardExample /></BlockFrame>; }\n"
    }
  ],
  "docs": "Documentation: https://ui.overtrue.xyz/blocks/emails-template-settings-1. Includes the shared card foundation and hosted demo imagery. Replace sample data and navigation with your application data."
}
