import React, { useMemo } from 'react';
import { PREFIX } from "../../status";
import "./index.less";
var CardMask = function CardMask(_ref) {
  var props = _ref.props;
  var isOpen = props.isOpen,
    fontSize = props.fontSize,
    fontWeight = props.fontWeight,
    color = props.color,
    slot = props.slot,
    text = props.text,
    background = props.background;

  // 不开启
  if (!isOpen) return null;

  // 开启插槽
  if (slot) return slot;
  var finalStyle = useMemo(function () {
    return {
      fontSize: fontSize,
      fontWeight: fontWeight,
      color: color,
      backgroundColor: background
    };
  }, [fontSize, fontWeight, color, background]);
  return text ? /*#__PURE__*/React.createElement("div", {
    className: "".concat(PREFIX, "__card-mask"),
    style: finalStyle
  }, /*#__PURE__*/React.createElement("span", {
    className: "".concat(PREFIX, "__card-mask-text")
  }, text)) : null;
};
export default CardMask;