{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "Past orders with status.",
  "devDependencies": [],
  "digest": "0.1.0",
  "files": [
    {
      "content": "// Code generated by packages/kit-compose/src/server-organisms.ts from packages/compose-gen/specs (compose-gen organism emitters on kit-compose). DO NOT EDIT.\n// Source: packages/compose-gen/specs/organisms/order-table.json\n\npackage blocks\n\nimport (\n\t\"github.com/ui8kit/codegen/generated/templ/ui/box\"\n\t\"github.com/ui8kit/codegen/generated/templ/compose\"\n\t\"github.com/ui8kit/codegen/generated/templ/ui/text\"\n\tuiutils \"github.com/ui8kit/codegen/generated/templ/orgutils\"\n)\n\n// OrderTableProps are the props of OrderTable; the values are the JSON shapes of the TypeScript props.\ntype OrderTableProps struct {\n\tId any `json:\"id\"`\n\tTitle any `json:\"title\"`\n\tOrders any `json:\"orders\"`\n\tEmpty any `json:\"empty\"`\n\tStatuses any `json:\"statuses\"`\n\tLabels any `json:\"labels\"`\n\tLayout any `json:\"layout\"`\n\tPager any `json:\"pager\"`\n\tTone any `json:\"tone\"`\n\tDensity any `json:\"density\"`\n\tLandmarkLabel any `json:\"landmarkLabel\"`\n}\n\n// The order history as a table or as cards: number, date, items, total and a status pill, with an optional pager. Axes: layout (table, cards), pager (show, hide), tone, density.\ntempl OrderTable(p OrderTableProps) {\n\t{{ vId := p.Id }}\n\t{{ vTitle := p.Title }}\n\t{{ vOrders := p.Orders }}\n\t{{ vEmpty := uiutils.Def(p.Empty, \"\") }}\n\t{{ vStatuses := p.Statuses }}\n\t{{ vLabels := p.Labels }}\n\t{{ vLayout := uiutils.Def(p.Layout, \"table\") }}\n\t{{ vPager := uiutils.Def(p.Pager, \"show\") }}\n\t{{ vTone := uiutils.Def(p.Tone, \"default\") }}\n\t{{ vDensity := uiutils.Def(p.Density, \"default\") }}\n\t{{ vLandmarkLabel := p.LandmarkLabel }}\n\t@SectionFrame(SectionFrameProps{Id: vId, Title: vTitle, Tone: vTone, Density: vDensity, LandmarkLabel: vLandmarkLabel}) {\n\t\tif uiutils.Eq(uiutils.Len(vOrders), float64(0)) {\n\t\t\t@EmptyState(EmptyStateProps{Icon: \"package\", Title: vEmpty})\n\t\t} else {\n\t\t\t@compose.Stack(compose.StackProps{Gap: \"4\", Align: \"stretch\", BoxProps: box.BoxProps{}}) {\n\t\t\t\tif uiutils.Eq(vLayout, \"table\") {\n\t\t\t\t\t@OrderRows(OrderRowsProps{Orders: vOrders, Statuses: vStatuses, Labels: vLabels, Density: vDensity})\n\t\t\t\t} else {\n\t\t\t\t\t@compose.Stack(compose.StackProps{Gap: \"4\", Align: \"stretch\", BoxProps: box.BoxProps{Attrs: uiutils.Attrs(\"data-slot\", \"order-cards\")}}) {\n\t\t\t\t\t\tfor _, vO := range uiutils.L(vOrders) {\n\t\t\t\t\t\t\t@compose.Card(compose.CardProps{Variant: \"default\", BoxProps: box.BoxProps{}}) {\n\t\t\t\t\t\t\t\t@compose.CardContent(compose.CardContentProps{BoxProps: box.BoxProps{Class: \"flex flex-wrap items-center justify-between gap-4\"}}) {\n\t\t\t\t\t\t\t\t\t@compose.Stack(compose.StackProps{Gap: \"0\", BoxProps: box.BoxProps{}}) {\n\t\t\t\t\t\t\t\t\t\t@compose.Text(compose.TextProps{Size: \"sm\", Weight: \"semibold\", TextProps: text.TextProps{}}) {\n\t\t\t\t\t\t\t\t\t\t\t{ uiutils.Text(uiutils.Get(vO, \"number\")) }\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t\t@compose.Text(compose.TextProps{Size: \"xs\", TextProps: text.TextProps{Class: \"text-muted-foreground\"}}) {\n\t\t\t\t\t\t\t\t\t\t\t{ uiutils.Text(uiutils.Get(vO, \"date\")) }\n\t\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@compose.Text(compose.TextProps{Size: \"sm\", TextProps: text.TextProps{}}) {\n\t\t\t\t\t\t\t\t\t\t{ uiutils.Text(uiutils.Tpl(uiutils.Get(vLabels, \"itemsCount\"), uiutils.Get(vO, \"items\"))) }\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@compose.Text(compose.TextProps{Size: \"sm\", Weight: \"bold\", TextProps: text.TextProps{}}) {\n\t\t\t\t\t\t\t\t\t\t{ uiutils.Text(uiutils.Money(uiutils.Get(vO, \"total\"), uiutils.Get(vO, \"currency\"))) }\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t\t@Pill(PillProps{Tone: uiutils.Cond(uiutils.T(uiutils.Eq(uiutils.Get(vO, \"status\"), \"paid\")), \"green\", uiutils.Cond(uiutils.T(uiutils.Eq(uiutils.Get(vO, \"status\"), \"shipped\")), \"blue\", uiutils.Cond(uiutils.T(uiutils.Eq(uiutils.Get(vO, \"status\"), \"pending\")), \"amber\", \"gray\")))}) {\n\t\t\t\t\t\t\t\t\t\t{ uiutils.Text(uiutils.At(vStatuses, uiutils.Get(vO, \"status\"))) }\n\t\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t\t}\n\t\t\t\t\t\t\t}\n\t\t\t\t\t\t}\n\t\t\t\t\t}\n\t\t\t\t}\n\t\t\t\tif uiutils.Eq(vPager, \"show\") {\n\t\t\t\t\t@Pager(PagerProps{Page: float64(1), Pages: float64(3), Summary: uiutils.Tpl(uiutils.Get(vLabels, \"summary\"), float64(1), float64(4), float64(12)), PreviousLabel: uiutils.Get(vLabels, \"previous\"), NextLabel: uiutils.Get(vLabels, \"next\")})\n\t\t\t\t}\n\t\t\t}\n\t\t}\n\t}\n}\n",
      "path": "blocks/order-table.templ",
      "target": "blocks/order-table.templ"
    }
  ],
  "meta": {
    "category": "commerce",
    "group": "account",
    "kind": "block",
    "tags": [
      "templ",
      "block"
    ]
  },
  "name": "order-table",
  "registryDependencies": [
    "card",
    "card-content",
    "empty-state",
    "kit-box",
    "kit-text",
    "order-rows",
    "pager",
    "pill",
    "section-frame",
    "stack",
    "text",
    "utils"
  ],
  "runtime": "templ",
  "title": "Order Table",
  "type": "registry:block"
}
