import { clsx } from 'clsx';
import { twMerge } from 'tailwind-merge';
import { jsx, jsxs } from 'react/jsx-runtime';

// src/lib/utils.ts
function cn(...inputs) {
  return twMerge(clsx(inputs));
}
function CommerceCart({ items, summary, actions, className }) {
  return /* @__PURE__ */ jsx("section", { className: cn("bg-background py-12 sm:py-16", className), children: /* @__PURE__ */ jsxs("div", { className: "mx-auto grid max-w-7xl gap-10 px-6 lg:grid-cols-3 lg:gap-12 lg:px-8", children: [
    /* @__PURE__ */ jsx("ul", { className: "divide-y divide-border lg:col-span-2", children: items.map((item, index) => /* @__PURE__ */ jsxs("li", { className: "flex gap-4 py-6 first:pt-0", children: [
      item.image ? /* @__PURE__ */ jsx("div", { className: "size-24 flex-none overflow-hidden rounded-lg bg-muted [&_img]:size-full [&_img]:object-cover", children: item.image }) : null,
      /* @__PURE__ */ jsxs("div", { className: "flex flex-1 flex-col gap-1", children: [
        /* @__PURE__ */ jsxs("div", { className: "flex items-start justify-between gap-3", children: [
          /* @__PURE__ */ jsx("h3", { className: "text-sm font-medium text-foreground", children: item.name }),
          /* @__PURE__ */ jsx("span", { className: "flex-none text-sm font-medium text-foreground", children: item.price })
        ] }),
        item.meta ? /* @__PURE__ */ jsx("p", { className: "text-sm text-muted-foreground", children: item.meta }) : null,
        /* @__PURE__ */ jsxs("div", { className: "mt-auto flex items-center justify-between gap-3 pt-2", children: [
          /* @__PURE__ */ jsxs("span", { className: "text-sm text-muted-foreground", children: [
            "Qty ",
            item.quantity
          ] }),
          item.controls ? /* @__PURE__ */ jsx("div", { className: "flex items-center gap-2", children: item.controls }) : null
        ] })
      ] })
    ] }, index)) }),
    summary || actions ? /* @__PURE__ */ jsx("div", { className: "lg:col-span-1", children: /* @__PURE__ */ jsxs("div", { className: "rounded-2xl border border-border bg-card p-6 text-card-foreground lg:sticky lg:top-6", children: [
      summary ? /* @__PURE__ */ jsx("div", { className: "flex flex-col gap-3", children: summary }) : null,
      actions ? /* @__PURE__ */ jsx("div", { className: "mt-6 [&_button]:w-full [&>*]:w-full", children: actions }) : null
    ] }) }) : null
  ] }) });
}

export { CommerceCart };
//# sourceMappingURL=commerce-cart.js.map
//# sourceMappingURL=commerce-cart.js.map