{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "kpi-01",
  "description": "A single value with its change and what it is compared with.",
  "registryDependencies": [
    "card",
    "https://www.dashboardblocks.com/r/radix/kpi.json"
  ],
  "files": [
    {
      "path": "registry/components/dashboardblocks/kpi/kpi-01.tsx",
      "content": "'use client'\n\nimport {\n  BlockStateProvider,\n  type BlockStateProps,\n  getBlockState,\n} from '@/registry/components/dashboardblocks/block-state'\nimport {\n  KPI,\n  KPIChange,\n  type KPIFormat,\n  KPITitle,\n  KPIValue,\n} from '@/registry/components/dashboardblocks/kpi'\n\nimport { Card, CardContent } from '@/components/ui/card'\n\ninterface KPI1Props extends BlockStateProps {\n  comparison: string\n  format?: KPIFormat\n  previous?: number\n  title: string\n  /** Leave out to show the empty state. */\n  value?: number\n}\n\nconst exampleProps: KPI1Props = {\n  comparison: 'last month',\n  format: 'currency',\n  previous: 37_660,\n  title: 'Total revenue',\n  value: 45_231,\n}\n\nconst KPI1 = (props: KPI1Props) => {\n  const { comparison, format, previous, errorMessage, status, title, value } = props\n\n  return (\n    <BlockStateProvider errorMessage={errorMessage} state={getBlockState(status, value)}>\n      <Card>\n        <CardContent>\n          <KPI className='gap-1'>\n            <KPITitle>{title}</KPITitle>\n            <KPIValue value={value} format={format} animated />\n            <KPIChange comparison={comparison} previous={previous} value={value} />\n          </KPI>\n        </CardContent>\n      </Card>\n    </BlockStateProvider>\n  )\n}\n\nexport { KPI1, exampleProps as kpi1ExampleProps, type KPI1Props }\n",
      "type": "registry:component",
      "target": "@components/dashboardblocks/kpi/kpi-01.tsx"
    }
  ],
  "meta": {
    "shows": "A single value with its change and what it is compared with.",
    "size": "compact",
    "usedWith": [
      "kpi-02",
      "stat-group-01",
      "chart-panel-01"
    ],
    "component": "KPI1",
    "props": "{ comparison: string; format?: \"number\" | \"compact\" | \"currency\" | \"currency-compact\" | \"percent\"; previous?: number; title: string; value?: number; errorMessage?: string; status?: \"loading\" | \"error\" }"
  },
  "type": "registry:component"
}
