nyuchimzizi
Mzizi — an open-architecture project of the Bundu Foundation, operated and developed by Nyuchi. Built on the Five African Minerals palette.
Built by Nyuchi Africav4.0.39
Order total breakdown with line items and total.
View the full component source code below.
import * as React from "react"
import { cn } from "@/lib/utils"
interface OrderSummaryItem {
label: string
amount: number
}
function OrderSummary({ loading = false,
items,
total,
currency = "USD",
className,
...props
}: {
items: OrderSummaryItem[]
total: number
currency?: string
} & React.ComponentProps<"div">) {
const formatter = new Intl.NumberFormat(undefined, { style: "currency", currency })
return (
<div data-slot="order-summary" data-portal="https://design.nyuchi.com/components/order-summary" className={cn("flex flex-col gap-3", className)} {...props}>
{items.map((item) => (
<div key={item.label} className="flex items-center justify-between text-sm">
<span className="text-muted-foreground">{item.label}</span>
<span className="text-foreground tabular-nums">{formatter.format(item.amount)}</span>
</div>
))}
<div className="h-px bg-border" role="separator" />
<div className="flex items-center justify-between">
<span className="text-sm font-semibold text-foreground">Total</span>
<span className="text-base font-bold text-foreground tabular-nums">
{formatter.format(total)}
</span>
</div>
</div>
)
}
export { OrderSummary, type OrderSummaryItem }
npx shadcn@latest add https://mzizi.dev/api/v1/ui/order-summaryFetch this component's metadata and source code from the registry API.
/api/v1/ui/order-summarycomponents/ui/order-summary.tsx