{ "$schema": "https://ui.shadcn.com/schema/registry-item.json", "name": "order-summary", "title": "Order Summary", "description": "A read-only order review with line items, subtotal, shipping, tax, and total.", "registryDependencies": [ "https://lumo-www.vercel.app/r/lib.json" ], "files": [ { "path": "packages/core/src/components/lumo/order-summary.tsx", "content": "import * as React from \"react\"\r\nimport type { CartLine, Money } from \"@/lib/lumo/types\"\r\nimport { formatMoney } from \"@/lib/lumo/money\"\r\n\r\nimport { cn } from \"@/lib/utils\"\r\n\r\nexport interface OrderSummaryProps extends React.HTMLAttributes {\r\n lines: CartLine[]\r\n subtotal: Money\r\n shipping?: Money\r\n tax?: Money\r\n total?: Money\r\n locale?: string\r\n title?: string\r\n}\r\n\r\nfunction Row({ label, value, strong }: { label: string; value: string; strong?: boolean }) {\r\n return (\r\n
\r\n {label}\r\n {value}\r\n
\r\n )\r\n}\r\n\r\nconst OrderSummary = React.forwardRef(\r\n ({ lines, subtotal, shipping, tax, total, locale, title = \"Order summary\", className, ...props }, ref) => {\r\n return (\r\n
\r\n

{title}

\r\n\r\n
    \r\n {lines.map((line) => {\r\n const image = line.product.images[0] ?? line.variant.image\r\n return (\r\n
  • \r\n
    \r\n {image && (\r\n {image.alt\r\n )}\r\n \r\n {line.quantity}\r\n \r\n
    \r\n
    \r\n

    {line.product.title}

    \r\n {line.variant.title &&

    {line.variant.title}

    }\r\n
    \r\n {formatMoney(line.lineTotal, { locale })}\r\n
  • \r\n )\r\n })}\r\n
\r\n\r\n
\r\n \r\n {shipping && }\r\n {tax && }\r\n
\r\n\r\n {total && (\r\n
\r\n \r\n
\r\n )}\r\n
\r\n )\r\n }\r\n)\r\nOrderSummary.displayName = \"OrderSummary\"\r\n\r\nexport { OrderSummary }\r\n", "type": "registry:ui", "target": "components/lumo/order-summary.tsx" } ], "type": "registry:ui" }