import React, { useContext } from 'react';
import cls from 'clsx';
import ConfigProviderContext from '../../config-provider/ConfigProviderContext';
import { BORDER_BOTTOM } from '../../utils/constant';

var SkuRow = function SkuRow(props) {
  var _useContext = useContext(ConfigProviderContext),
      prefixCls = _useContext.prefixCls,
      createNamespace = _useContext.createNamespace;

  var _createNamespace = createNamespace('sku-row', prefixCls),
      bem = _createNamespace[0];

  var skuRow = props.skuRow;

  var renderTitle = function renderTitle() {
    return /*#__PURE__*/React.createElement("div", {
      className: cls(bem('title'))
    }, skuRow.k, skuRow.is_multiple && /*#__PURE__*/React.createElement("span", {
      className: cls(bem('title-multiple'))
    }, "\uFF08\u53EF\u591A\u9009\uFF09"));
  };

  var renderContent = function renderContent() {
    var largeImageMode = skuRow.largeImageMode;
    return largeImageMode ? /*#__PURE__*/React.createElement("div", {
      className: cls(bem('scroller'))
    }, /*#__PURE__*/React.createElement("div", {
      className: cls(bem('row'))
    }, props.children)) : props.children;
  };

  return /*#__PURE__*/React.createElement("div", {
    className: cls(bem(), BORDER_BOTTOM)
  }, renderTitle(), renderContent());
};

export default SkuRow;