{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "author": "Lopifi (https://lopifi.com)",
  "categories": [
    "accounting-core-gl",
    "finance",
    "accounting"
  ],
  "dependencies": [],
  "description": "Template editable; instances read-only.",
  "files": [
    {
      "content": "\"use client\";\n\nimport { cn } from \"@/lib/ledger/cn\";\nimport { formatDate } from \"@/lib/ledger/fiscal-period\";\nimport type { MoneyValue } from \"@/lib/ledger/money.types\";\nimport { ArrowPathRoundedSquareIcon, LockClosedIcon } from \"@/components/ledger/icons\";\nimport { Money } from \"@/components/ledger/money\";\nimport { type Frequency, nextOccurrences } from \"@/components/ledger/recurring-schedule\";\nimport { StatusPill } from \"@/components/ledger/status-pill\";\n\nexport type RecurringInstance = {\n  id: string;\n  date: Date;\n  amount: MoneyValue;\n  posted: boolean;\n};\n\nexport interface RecurringEntryTemplateProps {\n  amount: MoneyValue;\n  className?: string;\n  frequency: Frequency;\n  instances: RecurringInstance[];\n  name: string;\n  onEdit?: () => void;\n  startDate: Date;\n}\n\n/**\n * The template is editable and edits apply **forward only**. Instances are\n * `source: \"recurring\"` and read-only — editing a posted instance would\n * silently detach it from the template that explains it.\n */\nexport function RecurringEntryTemplate({\n  name,\n  amount,\n  frequency,\n  startDate,\n  instances,\n  onEdit,\n  className,\n}: RecurringEntryTemplateProps) {\n  const upcoming = nextOccurrences(startDate, frequency, 3);\n\n  return (\n    <div className={cn(\"rounded-xl border border-border bg-surface\", className)}>\n      <header className=\"flex flex-wrap items-start justify-between gap-3 border-b border-border-subtle px-6 py-4\">\n        <div>\n          <p className=\"flex items-center gap-2 text-body font-medium\">\n            <ArrowPathRoundedSquareIcon aria-hidden=\"true\" className=\"size-4 text-text-tertiary\" />\n            {name}\n          </p>\n          <p className=\"text-caption text-text-secondary\">\n            <Money size=\"xs\" tone=\"inherit\" value={amount} /> · {frequency} · started {formatDate(startDate)}\n          </p>\n        </div>\n        <button className=\"text-label font-medium text-accent hover:underline\" onClick={onEdit} type=\"button\">\n          Edit template\n        </button>\n      </header>\n\n      <section className=\"px-6 py-4\">\n        <h3 className=\"text-label font-medium text-text-secondary\">Upcoming</h3>\n        <ul className=\"mt-2 space-y-1\">\n          {upcoming.map((d) => (\n            <li className=\"numeric text-body\" key={d.toISOString()}>\n              {formatDate(d)}\n            </li>\n          ))}\n        </ul>\n      </section>\n\n      <section className=\"border-t border-border-subtle px-6 py-4\">\n        <h3 className=\"text-label font-medium text-text-secondary\">Posted instances</h3>\n        <ul className=\"mt-2 space-y-1\">\n          {instances.map((i) => (\n            <li className=\"flex items-center gap-3\" key={i.id}>\n              <LockClosedIcon aria-label=\"Read-only\" className=\"size-3 shrink-0 text-text-tertiary\" />\n              <span className=\"numeric flex-1 text-body\">{formatDate(i.date)}</span>\n              <StatusPill entity=\"Entry\" status={i.posted ? \"settled\" : \"scheduled\"} />\n              <Money accounting value={i.amount} />\n            </li>\n          ))}\n        </ul>\n        <p className=\"mt-2 text-caption text-text-tertiary\">\n          Instances are read-only. Template edits apply forward only.\n        </p>\n      </section>\n    </div>\n  );\n}\n",
      "path": "components/ledger/recurring-entry-template.tsx",
      "target": "components/ledger/recurring-entry-template.tsx",
      "type": "registry:component"
    }
  ],
  "meta": {
    "license": "MIT"
  },
  "name": "recurring-entry-template",
  "registryDependencies": [
    "@lopifi/theme",
    "@lopifi/cn",
    "@lopifi/fiscal-period",
    "@lopifi/icons",
    "@lopifi/money",
    "@lopifi/money.types",
    "@lopifi/recurring-schedule",
    "@lopifi/status-pill"
  ],
  "title": "RecurringEntryTemplate",
  "type": "registry:component"
}
