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