/*! ratio-ui · design system for knowledge sharing · https://github.com/losol/ratio-ui · (c) 2026 Losol AS · MPL-2.0 */
import { Heading } from "../../core/Heading/Heading.js";
import "../../core/Heading/index.js";
import "react";
import { Fragment, jsx, jsxs } from "react/jsx-runtime";
//#region src/commerce/OrderSummary/OrderSummary.tsx
/**
* OrderSummary - Display order totals and summary
*
* @example
* ```tsx
* import { OrderSummary } from '@eventuras/ratio-ui/commerce/OrderSummary';
* import { CartLineItem } from '@eventuras/ratio-ui/commerce/CartLineItem';
* import { formatPrice } from '@eventuras/core/currency';
*
* <OrderSummary
*   summary={cartSummary}
*   locale="nb"
*   formatPrice={formatPrice}
*   title="Ordresammendrag"
*   showVatBreakdown
* >
*   {cartSummary.items.map(item => (
*     <CartLineItem key={item.productId} item={item} ... />
*   ))}
* </OrderSummary>
* ```
*/
var OrderSummary = ({ summary, locale, formatPrice, title = "Ordresammendrag", showVatBreakdown = false, children }) => {
	return /* @__PURE__ */ jsxs(Fragment, { children: [
		/* @__PURE__ */ jsx(Heading, {
			as: "h2",
			paddingBottom: "sm",
			children: title
		}),
		children && /* @__PURE__ */ jsx("div", {
			className: "space-y-4 mb-6 pb-6 border-b border-border-1",
			children
		}),
		/* @__PURE__ */ jsxs("div", {
			className: "space-y-2",
			children: [showVatBreakdown && /* @__PURE__ */ jsxs(Fragment, { children: [/* @__PURE__ */ jsxs("div", {
				className: "flex justify-between text-sm text-(--text-muted)",
				children: [/* @__PURE__ */ jsx("span", { children: "Subtotal (eks. mva)" }), /* @__PURE__ */ jsx("span", { children: formatPrice(summary.subtotalExVat, summary.currency, locale) })]
			}), /* @__PURE__ */ jsxs("div", {
				className: "flex justify-between text-sm text-(--text-muted)",
				children: [/* @__PURE__ */ jsx("span", { children: "MVA" }), /* @__PURE__ */ jsx("span", { children: formatPrice(summary.totalVat, summary.currency, locale) })]
			})] }), /* @__PURE__ */ jsxs("div", {
				className: "flex justify-between items-center pt-2 border-t border-border-1",
				children: [/* @__PURE__ */ jsx("span", {
					className: "text-lg font-semibold text-(--text)",
					children: "Total"
				}), /* @__PURE__ */ jsx("span", {
					className: "text-2xl font-bold text-(--text)",
					children: formatPrice(summary.totalIncVat, summary.currency, locale)
				})]
			})]
		})
	] });
};
//#endregion
export { OrderSummary };

//# sourceMappingURL=OrderSummary.js.map