import React from 'react';
import { locales } from '@pisell/utils';
import "./index.less";
import { PREFIX } from "../../index";
var Specs = function Specs(props) {
  var _props$dataSource = props.dataSource,
    dataSource = _props$dataSource === void 0 ? {} : _props$dataSource;
  var bundle = dataSource.bundle,
    options = dataSource.options,
    product_option_string = dataSource.product_option_string,
    symbol = dataSource.symbol;
  var more = /*#__PURE__*/React.createElement("div", {
    style: {
      color: '#667085',
      fontSize: 10,
      lineHeight: '10px'
    }
  }, locales.getText('pisell2.cart.sku-card.more'));
  if (Array.isArray(bundle) && (bundle === null || bundle === void 0 ? void 0 : bundle.length) > 0) {
    var first = bundle[0];
    return /*#__PURE__*/React.createElement("div", {
      className: "".concat(PREFIX, "__specs")
    }, /*#__PURE__*/React.createElement("div", null, first.title), bundle.length > 1 ? more : null);
  }
  if (product_option_string) {
    return /*#__PURE__*/React.createElement("div", {
      className: "".concat(PREFIX, "__specs")
    }, /*#__PURE__*/React.createElement("div", null, product_option_string), options.length > 1 ? more : null);
  }
  if (options.length > 0) {
    var _first = options[0];
    return /*#__PURE__*/React.createElement("div", {
      className: "".concat(PREFIX, "__specs")
    }, /*#__PURE__*/React.createElement("div", {
      className: "spec-item"
    }, /*#__PURE__*/React.createElement("span", {
      className: "spec-name"
    }, _first.name), /*#__PURE__*/React.createElement("span", {
      className: "spec-num"
    }, /*#__PURE__*/React.createElement("span", null, symbol, _first.price), /*#__PURE__*/React.createElement("span", null), "x", /*#__PURE__*/React.createElement("span", null, _first.num))), options.length > 1 ? more : null);
  }
  return null;
};
export default Specs;