@shopify/shop-minis-react
Version:
React component library for Shopify Shop Minis with Tailwind CSS v4 support (source-only, requires TypeScript)
55 lines (54 loc) • 1.25 kB
JavaScript
import { jsx as n, jsxs as h, Fragment as d } from "react/jsx-runtime";
import { cn as i } from "../../lib/utils.js";
import { formatMoney as a } from "../../utils/formatMoney.js";
function N({
amount: r,
currencyCode: t,
compareAtPriceAmount: s,
compareAtPriceCurrencyCode: o,
currentPriceClassName: e,
originalPriceClassName: m,
className: x
}) {
if (!r || !t)
return null;
const f = s && s !== r, l = String(r), g = s ? String(s) : void 0;
return /* @__PURE__ */ n("div", { className: i("flex items-center gap-2", x), children: f ? /* @__PURE__ */ h(d, { children: [
/* @__PURE__ */ n(
"span",
{
className: i(
"text-sm font-semibold text-gray-900",
e
),
children: a(l, t)
}
),
/* @__PURE__ */ n(
"span",
{
className: i(
"text-sm text-gray-500 line-through",
m
),
children: a(
g,
o || t
)
}
)
] }) : /* @__PURE__ */ n(
"span",
{
className: i(
"text-sm font-semibold text-gray-900",
e
),
children: a(l, t)
}
) });
}
export {
N as ProductVariantPrice
};
//# sourceMappingURL=product-variant-price.js.map