Your Name 1912bcd25b
Some checks failed
Lint / build (20) (push) Has been cancelled
Playwright Tests / test (push) Has been cancelled
chore: sync all remaining local workspace changes
2026-05-08 11:26:57 +08:00

102 lines
3.0 KiB
JavaScript

/*
* Extracted from browser-delivered Turbopack chunk: cde068e14ffee6a8.f8b5a2ab76.js
* Module id: 745705
* For reading/searching only; this factory depends on the original Turbopack runtime.
*/
const moduleFactory = (e) => {
"use strict";
var t = e.i(462214),
i = e.i(358379),
n = e.i(41671),
r = e.i(722573),
a = e.i(41114),
o = e.i(136036);
function u({
strikethroughPrice: e = !1,
power: u,
originalPrice: l,
scale: s = 1,
isCalculating: d,
promotionTooltip: c,
className: m,
iconClassName: f,
valueClassName: p,
}) {
let g = e && "-" !== u && "number" == typeof u,
v = (0, i.useMemo)(
() =>
g && "number" == typeof u
? (0, o.resolveStrikethroughPowerDisplay)({
strikethroughPrice: !0,
power: u,
originalPrice: l,
})
: null,
[g, u, l],
),
h = (0, i.useMemo)(
() =>
v && 1 !== s
? {
primary: v.primary * s,
strikeThrough:
null != v.strikeThrough ? v.strikeThrough * s : void 0,
}
: v,
[v, s],
),
$ = (0, i.useMemo)(() => {
if (d)
return (0, t.jsx)(n.Icons.loader2, {
className: (0, a.cn)("inline-block size-3 animate-spin", p),
});
if ("-" === u) return "-";
if (!h) return String("number" == typeof u ? u * s : u);
let e = h.strikeThrough;
return null != e && e !== h.primary
? (0, t.jsxs)("span", {
className: "inline-flex items-center gap-0.5",
children: [
(0, t.jsx)("span", { children: h.primary }),
(0, t.jsx)("span", {
className: "text-fg-muted opacity-70",
children: "/",
}),
(0, t.jsx)("span", {
className: "text-fg-muted line-through opacity-70",
children: e,
}),
],
})
: (0, t.jsx)("span", { children: h.primary });
}, [d, u, h, s, p]),
y = (0, t.jsxs)("span", {
className: (0, a.cn)("flex shrink-0 items-center gap-[2px]", m),
children: [
(0, t.jsx)(n.Icons.zap, {
className: (0, a.cn)("h-[14px] w-[10px]", f),
}),
(0, t.jsx)("span", {
className: (0, a.cn)(
"min-w-5 text-center text-[12px] font-normal leading-[15px]",
p,
),
children: $,
}),
],
});
return c
? (0, t.jsx)(r.Tooltip, {
label: c,
position: "top",
withArrow: !0,
children: y,
})
: y;
}
e.s(["GeneratorPowerCostDisplay", () => u]);
};
export default moduleFactory;