const require_runtime = require("../../../../../../_virtual/_rolldown/runtime.js");
const require_status = require("../../status.js");
let react = require("react");
react = require_runtime.__toESM(react);
let antd = require("antd");
let _pisell_utils = require("@pisell/utils");
require("./index.less");
//#region src/plus/productSelect/ProductCard/SkuCard/components/Countdown/index.tsx
const { Countdown: AntdCountdown } = antd.Statistic;
const Countdown = ({ props }) => {
	const { dataSource, skuTextConfig } = props;
	const { isOpen, fontSize, fontWeight, color, customText } = (skuTextConfig === null || skuTextConfig === void 0 ? void 0 : skuTextConfig.skuCountdownConfig) || {};
	if (!isOpen) return null;
	if (customText) return customText;
	const finalStyle = (0, react.useMemo)(() => {
		return {
			fontSize,
			fontWeight,
			color
		};
	}, [
		fontSize,
		fontWeight,
		color
	]);
	return (dataSource === null || dataSource === void 0 ? void 0 : dataSource.countdown) ? /* @__PURE__ */ react.default.createElement("div", {
		className: `${require_status.PREFIX}__card-countdown`,
		style: finalStyle
	}, /* @__PURE__ */ react.default.createElement("span", null, _pisell_utils.locales.getText("pisell2.sku-card.time.remaining"), ": "), /* @__PURE__ */ react.default.createElement(AntdCountdown, {
		value: dataSource === null || dataSource === void 0 ? void 0 : dataSource.countdown,
		format: "HH:mm:ss",
		valueStyle: finalStyle
	})) : null;
};
//#endregion
exports.default = Countdown;
