{
  "$schema": "https://ui.shadcn.com/schema/registry-item.json",
  "name": "lists-20",
  "type": "registry:block",
  "description": "Bank transaction ledger grouped by date with daily net and in/out totals.",
  "dependencies": [
    "lucide-react"
  ],
  "registryDependencies": [],
  "files": [
    {
      "path": "registry/designali/blocks/lists/lists-20.tsx",
      "content": "import {\n  ArrowDownLeft,\n  ArrowUpRight,\n  Briefcase,\n  Car,\n  Coffee,\n  ShoppingBag,\n  Wifi,\n} from \"@designali/icons\"\n\nimport type * as React from \"react\"\n\ntype IconComponent = React.ComponentType<React.SVGProps<SVGSVGElement> & { size?: number | string; strokeWidth?: number }>\n\ntype Txn = { merchant: string; category: string; icon: IconComponent; amount: number; method: string; pending?: boolean }\n\nconst ledger: { date: string; items: Txn[] }[] = [\n  {\n    date: \"Today, Nov 15\",\n    items: [\n      { merchant: \"Studio coffee\", category: \"Coffee\", icon: Coffee, amount: -4.8, method: \"•• 4021\", pending: true },\n      { merchant: \"Designali client, brand identity\", category: \"Client payment\", icon: Briefcase, amount: 3200, method: \"Transfer\" },\n    ],\n  },\n  {\n    date: \"Thu, Nov 13\",\n    items: [\n      { merchant: \"Template sales, designali.com\", category: \"Sales\", icon: ShoppingBag, amount: 86.42, method: \"•• 4021\" },\n      { merchant: \"Travel to client workshop\", category: \"Transport\", icon: Car, amount: -18.5, method: \"•• 4021\" },\n      { merchant: \"Studio broadband\", category: \"Utilities\", icon: Wifi, amount: -42, method: \"Direct debit\" },\n    ],\n  },\n  {\n    date: \"Tue, Nov 11\",\n    items: [\n      { merchant: \"Transfer from Savings\", category: \"Internal\", icon: ArrowDownLeft, amount: 500, method: \"Pot\" },\n      { merchant: \"Studio rent\", category: \"Workspace\", icon: ArrowUpRight, amount: -1450, method: \"Standing order\" },\n    ],\n  },\n]\n\nfunction money(n: number) {\n  const value = Math.abs(n).toLocaleString(\"en-US\", { minimumFractionDigits: 2, maximumFractionDigits: 2 })\n  return `${n < 0 ? \"-\" : \"+\"}$${value}`\n}\n\nexport default function Lists20() {\n  const all = ledger.flatMap((day) => day.items)\n  const income = all.filter((t) => t.amount > 0).reduce((s, t) => s + t.amount, 0)\n  const spent = all.filter((t) => t.amount < 0).reduce((s, t) => s + t.amount, 0)\n\n  return (\n    <section className=\"w-full bg-background py-24\">\n      <div className=\"mx-auto max-w-2xl px-6\">\n        <div className=\"border border-border\">\n          <div className=\"grid grid-cols-2 divide-x divide-border border-b border-border\">\n            <div className=\"p-5\">\n              <p className=\"text-xs text-muted-foreground\">Money in</p>\n              <p className=\"mt-1 font-sans text-xl font-semibold text-primary dark:text-primary\">{money(income)}</p>\n            </div>\n            <div className=\"p-5\">\n              <p className=\"text-xs text-muted-foreground\">Money out</p>\n              <p className=\"mt-1 font-sans text-xl font-semibold\">{money(spent)}</p>\n            </div>\n          </div>\n\n          {ledger.map((day) => {\n            const net = day.items.reduce((s, t) => s + t.amount, 0)\n            return (\n              <div key={day.date}>\n                <div className=\"flex items-center justify-between bg-muted/50 px-5 py-2 text-xs\">\n                  <span className=\"font-medium\">{day.date}</span>\n                  <span className=\"font-sans text-muted-foreground\">{money(net)}</span>\n                </div>\n                <ul className=\"divide-y divide-border\">\n                  {day.items.map((txn) => (\n                    <li key={txn.merchant} className=\"flex items-center gap-4 px-5 py-4 hover:bg-muted/30\">\n                      <span className=\"flex size-10 shrink-0 items-center justify-center border border-border bg-background\">\n                        <txn.icon className=\"size-4 text-muted-foreground\" />\n                      </span>\n                      <span className=\"min-w-0 flex-1\">\n                        <span className=\"block truncate text-sm font-medium\">{txn.merchant}</span>\n                        <span className=\"block truncate text-xs text-muted-foreground\">\n                          {txn.category} · {txn.method}\n                        </span>\n                      </span>\n                      <span className=\"text-right\">\n                        <span\n                          className={`block font-sans text-sm ${\n                            txn.amount > 0 ? \"text-primary dark:text-primary\" : \"\"\n                          }`}\n                        >\n                          {money(txn.amount)}\n                        </span>\n                        {txn.pending && (\n                          <span className=\"text-[10px] tracking-wider text-primary uppercase dark:text-primary\">\n                            Pending\n                          </span>\n                        )}\n                      </span>\n                    </li>\n                  ))}\n                </ul>\n              </div>\n            )\n          })}\n\n          <a href=\"#\" className=\"block border-t border-border py-3 text-center text-xs text-muted-foreground hover:bg-muted/40 hover:text-foreground\">\n            View all transactions\n          </a>\n        </div>\n      </div>\n    </section>\n  )\n}\n",
      "type": "registry:component"
    }
  ],
  "meta": {
    "iframeHeight": "850px"
  },
  "categories": [
    "lists"
  ]
}