{
  "$schema": "https://registry.buildy.tw/schema/registry-item.json",
  "dependencies": [],
  "description": "The price line of a product page: the price (integer minor units in the currency), the old price (compare_at) struck through when higher, and the badge.",
  "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/product-price.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// ProductPriceProps are the props of ProductPrice; the values are the JSON shapes of the TypeScript props.\ntype ProductPriceProps struct {\n\tPrice any `json:\"price\"`\n\tCompareAt any `json:\"compareAt\"`\n\tCurrency any `json:\"currency\"`\n\tBadge any `json:\"badge\"`\n\tWas any `json:\"was\"`\n}\n\n// The price line of a product page: the price (integer minor units in the currency), the old price (compare_at) struck through when higher, and the badge.\ntempl ProductPrice(p ProductPriceProps) {\n\t{{ vPrice := p.Price }}\n\t{{ vCompareAt := p.CompareAt }}\n\t{{ vCurrency := p.Currency }}\n\t{{ vBadge := uiutils.Def(p.Badge, \"\") }}\n\t{{ vWas := p.Was }}\n\t@compose.Group(compose.GroupProps{Gap: \"4\", Align: \"center\", BoxProps: box.BoxProps{Class: \"flex-wrap\", Attrs: uiutils.Attrs(\"data-slot\", \"product-price\")}}) {\n\t\t@compose.Text(compose.TextProps{Size: \"4xl\", Weight: \"bold\", TextProps: text.TextProps{}}) {\n\t\t\t{ uiutils.Text(uiutils.Money(vPrice, vCurrency)) }\n\t\t}\n\t\tif uiutils.T(uiutils.And(vCompareAt, uiutils.Gt(vCompareAt, vPrice))) {\n\t\t\t@compose.Text(compose.TextProps{Size: \"lg\", TextProps: text.TextProps{Tag: \"del\", Class: \"relative text-muted-foreground\", Attrs: uiutils.Attrs(\"data-slot\", \"compare-at\")}}) {\n\t\t\t\t@compose.Inline(compose.InlineProps{TextProps: text.TextProps{Class: \"sr-only\"}}) {\n\t\t\t\t\t{ uiutils.Text(vWas) }\n\t\t\t\t}\n\t\t\t\t{ uiutils.Text(uiutils.Money(vCompareAt, vCurrency)) }\n\t\t\t}\n\t\t}\n\t\tif uiutils.T(vBadge) {\n\t\t\t@compose.Badge(compose.BadgeProps{Variant: \"default\", Size: \"default\", TextProps: text.TextProps{}}) {\n\t\t\t\t{ uiutils.Text(vBadge) }\n\t\t\t}\n\t\t}\n\t}\n}\n",
      "path": "blocks/product-price.templ",
      "target": "blocks/product-price.templ"
    }
  ],
  "meta": {
    "category": "components",
    "kind": "component",
    "tags": [
      "templ",
      "component"
    ]
  },
  "name": "product-price",
  "registryDependencies": [
    "badge",
    "group",
    "inline",
    "kit-box",
    "kit-text",
    "text",
    "utils"
  ],
  "runtime": "templ",
  "title": "Product Price",
  "type": "registry:component"
}
