import { PREFIX } from "../../status.js";
import React, { useMemo } from "react";
import "./index.less";
//#region src/plus/productSelect/ProductCard/SkuCard/components/CardMask/index.tsx
const CardMask = ({ props }) => {
	const { isOpen, fontSize, fontWeight, color, slot, text, background } = props;
	if (!isOpen) return null;
	if (slot) return slot;
	const finalStyle = useMemo(() => {
		return {
			fontSize,
			fontWeight,
			color,
			backgroundColor: background
		};
	}, [
		fontSize,
		fontWeight,
		color,
		background
	]);
	return text ? /* @__PURE__ */ React.createElement("div", {
		className: `${PREFIX}__card-mask`,
		style: finalStyle
	}, /* @__PURE__ */ React.createElement("span", { className: `${PREFIX}__card-mask-text` }, text)) : null;
};
//#endregion
export { CardMask as default };
