{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "The orders as a table (the table layout of OrderTable): number, date, items, total and a status pill.",
  "devDependencies": [],
  "digest": "0.1.0",
  "files": [
    {
      "content": "// Code generated by packages/kit-compose/src/organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.\n/** The orders as a table (the table layout of OrderTable): number, date, items, total and a status pill. */\nimport { For, type JSX } from \"solid-js\";\nimport { Box, Table, TableBody, TableCaption, TableCell, TableHead, TableHeadCell, TableRow } from \"../compose\";\nimport { Pill } from \"../components/pill\";\nimport { at, cn, fmtMoney, tpl } from \"../utils\";\nimport type { Order, OrderLabels } from \"../blocks/order-table.types\";\n\nexport type OrderRowsProps = {\n  orders: Order[];\n  statuses: Record<string, string>;\n  labels: OrderLabels;\n  density?: \"default\" | \"compact\";\n};\n\nexport function OrderRows({ orders, statuses, labels, density = \"default\" }: OrderRowsProps) {\n  return (\n    <Box class=\"w-full overflow-x-auto\" data-slot=\"order-rows\">\n      <Table class=\"w-full text-left text-sm\" data-slot=\"order-table\">\n        <TableCaption class=\"sr-only\">\n          {labels.caption}\n        </TableCaption>\n        <TableHead>\n          <TableRow>\n            <TableHeadCell scope=\"col\" class=\"py-2\">\n              {labels.number}\n            </TableHeadCell>\n            <TableHeadCell scope=\"col\" class=\"py-2\">\n              {labels.date}\n            </TableHeadCell>\n            <TableHeadCell scope=\"col\" class=\"py-2\">\n              {labels.items}\n            </TableHeadCell>\n            <TableHeadCell scope=\"col\" class=\"py-2\">\n              {labels.total}\n            </TableHeadCell>\n            <TableHeadCell scope=\"col\" class=\"py-2\">\n              {labels.status}\n            </TableHeadCell>\n          </TableRow>\n        </TableHead>\n        <TableBody>\n          <For each={orders ?? []}>{(o) => (\n            <TableRow class=\"border-t border-border\" data-slot=\"item\">\n              <TableCell class={cn(\"font-semibold\", (((density as string) === \"compact\") ? \"py-2\" : \"py-4\"))}>\n                {o.number}\n              </TableCell>\n              <TableCell>\n                {o.date}\n              </TableCell>\n              <TableCell>\n                {tpl(labels.itemsCount, o.items)}\n              </TableCell>\n              <TableCell>\n                {fmtMoney(o.total, o.currency)}\n              </TableCell>\n              <TableCell>\n                <Pill\n                  tone={\n                    o.status === \"paid\" ? \"green\"\n                    : o.status === \"shipped\" ? \"blue\"\n                    : o.status === \"pending\" ? \"amber\"\n                    : \"gray\"\n                  }\n                >\n                  {at(statuses, o.status)}\n                </Pill>\n              </TableCell>\n            </TableRow>\n          )}</For>\n        </TableBody>\n      </Table>\n    </Box>\n  );\n}\n",
      "path": "components/order-rows.tsx",
      "target": "components/order-rows.tsx"
    }
  ],
  "meta": {
    "category": "components",
    "kind": "component",
    "tags": [
      "solid",
      "component"
    ]
  },
  "name": "order-rows",
  "registryDependencies": [
    "compose",
    "order-table",
    "pill",
    "utils"
  ],
  "runtime": "solid",
  "title": "Order Rows",
  "type": "registry:component"
}
