import React, { useMemo } from 'react';
import { PREFIX } from "../../status";
var Resource = function Resource(_ref) {
  var props = _ref.props;
  var dataSource = props.dataSource,
    skuTextConfig = props.skuTextConfig;
  var _ref2 = (skuTextConfig === null || skuTextConfig === void 0 ? void 0 : skuTextConfig.skuResourceConfig) || {},
    isOpen = _ref2.isOpen,
    fontSize = _ref2.fontSize,
    fontWeight = _ref2.fontWeight,
    color = _ref2.color,
    customText = _ref2.customText;

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

  // 自定义文本
  if (customText) return customText;
  var finalStyle = useMemo(function () {
    return {
      fontSize: fontSize,
      fontWeight: fontWeight,
      color: color
    };
  }, [fontSize, fontWeight, color]);
  return dataSource !== null && dataSource !== void 0 && dataSource.resources ? /*#__PURE__*/React.createElement("div", {
    className: "".concat(PREFIX, "__card-resource"),
    style: finalStyle
  }, dataSource === null || dataSource === void 0 ? void 0 : dataSource.resources) : null;
};
export default Resource;