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

61 lines
1.7 KiB
JavaScript

/*
* Extracted from browser-delivered Turbopack chunk: 5d5b47876e53e564.da1ba52a93.js
* Module id: 339039
* For reading/searching only; this factory depends on the original Turbopack runtime.
*/
const moduleFactory = (e) => {
"use strict";
var t = e.i(462214),
r = e.i(358379),
n = e.i(303267);
let o = (e) => e.toString().padStart(2, "0"),
a = (e) => {
let t = Math.floor((new Date(e).getTime() - Date.now()) / 1e3);
return t > 0 ? t : 0;
};
e.s([
"CountdownTimer",
0,
({ countdownAt: e, showText: i = !0 }) => {
let [l, s] = (0, r.useState)(() => a(e)),
c = (0, r.useCallback)(() => a(e), [e]);
(0, r.useEffect)(() => {
s(c());
let e = setInterval(() => {
let t = c();
s(t), t <= 0 && clearInterval(e);
}, 1e3);
return () => clearInterval(e);
}, [c]);
let u = Math.floor(l / 3600),
d = Math.floor((l % 3600) / 60);
return (0, t.jsx)("div", {
className: `${n.default.countdownTimer} py-1 px-2`,
children: (0, t.jsxs)("span", {
className: n.default.timer,
children: [
(0, t.jsx)("span", {
className: n.default.timeFrame,
children: o(u),
}),
":",
(0, t.jsx)("span", {
className: n.default.timeFrame,
children: o(d),
}),
":",
(0, t.jsx)("span", {
className: n.default.timeFrame,
children: o(l % 60),
}),
" 后失效",
],
}),
});
},
]);
};
export default moduleFactory;