{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "card-ai-usage-monthly-spend-limit-1",
  "type": "registry:block",
  "title": "Monthly spend limit",
  "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/ai-usage-monthly-spend-limit-1.tsx",
      "type": "registry:component",
      "target": "components/overtrue/blocks/ai-usage-monthly-spend-limit-1.tsx",
      "content": "\"use client\";\nimport { BlockFrame } from \"./runtime/blocks/frame\";\nimport \"./runtime/cards.css\";\n// Extracted from src/components/overtrue/scenes/insights.tsx:220.\nimport { sampleModelUsage } from \"./runtime/registry/overtrue/model-usage\";\nimport { ResourceProgress } from \"./runtime/registry/overtrue/resource-progress\";\nimport { useState } from \"react\";\nimport { SceneCard, Action } from \"./runtime/components/overtrue/scenes/shared\";\n\nfunction CardExample() {\n  const [budget, setBudget] = useState(\"500\");\n  const [savedBudget, setSavedBudget] = useState(500);\n  const [notice, setNotice] = useState(\"\");\n  const spend = sampleModelUsage.models.reduce(\n    (sum, model) => sum + model.cost,\n    0,\n  );\n\n  return (\n    <>\n      <div className=\"overtrue-block-content\" data-workspace-page=\"ai-usage\">\n        <SceneCard\n          title=\"Monthly spend limit\"\n          description=\"Set the warning threshold for the studio assistant.\"\n        >\n          <form\n            className=\"scene-form\"\n            onSubmit={(e) => {\n              e.preventDefault();\n              setSavedBudget(Number(budget));\n              setNotice(\"Budget warning threshold saved in this preview.\");\n            }}\n          >\n            <label>\n              Budget in USD\n              <input\n                type=\"number\"\n                required\n                min={1}\n                step={1}\n                value={budget}\n                onChange={(e) => {\n                  setBudget(e.target.value);\n                  setNotice(\"\");\n                }}\n              />\n            </label>\n            <ResourceProgress\n              label=\"Spend this month\"\n              value={spend}\n              max={savedBudget}\n              valueLabel={`$${spend.toFixed(2)} of $${savedBudget.toLocaleString()}`}\n            />\n            <Action type=\"submit\" primary>\n              Save budget\n            </Action>\n            <p role=\"status\">{notice}</p>\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/ai-usage-monthly-spend-limit-1. Includes the shared card foundation and hosted demo imagery. Replace sample data and navigation with your application data."
}
