import { PREFIX } from "../../status.js";
import React, { useMemo } from "react";
//#region src/plus/productSelect/ProductCard/SkuCard/components/Duration/index.tsx
const Duration = ({ props }) => {
	const { dataSource, skuTextConfig } = props;
	const { isOpen, fontSize, fontWeight, color, customText } = (skuTextConfig === null || skuTextConfig === void 0 ? void 0 : skuTextConfig.skuDurationConfig) || {};
	if (!isOpen) return null;
	if (customText) return customText;
	const finalStyle = useMemo(() => {
		return {
			fontSize,
			fontWeight,
			color
		};
	}, [
		fontSize,
		fontWeight,
		color
	]);
	return (dataSource === null || dataSource === void 0 ? void 0 : dataSource.duration) ? /* @__PURE__ */ React.createElement("div", {
		className: `${PREFIX}__card-duration`,
		style: finalStyle
	}, (dataSource === null || dataSource === void 0 ? void 0 : dataSource.duration) || "") : null;
};
//#endregion
export { Duration as default };
