import _Box from "@alifd/next/es/box";
import _objectDestructuringEmpty from "@babel/runtime/helpers/objectDestructuringEmpty";
import _extends from "@babel/runtime/helpers/extends";
import * as React from 'react';
import { replaceNode, transformColorStyle, transformCommonProps } from "../util";
var Div = function div(_ref) {
  var props = _extends({}, (_objectDestructuringEmpty(_ref), _ref));
  var customStyle = (props.customStyle || []).reduce(function (obj, item) {
    var _Object$assign;
    return Object.assign(obj, (_Object$assign = {}, _Object$assign[item.name] = item.value, _Object$assign));
  }, {});
  var colorStyle = transformColorStyle(customStyle);
  var commonProps = transformCommonProps(props);
  var _props = _extends({}, props);
  _props.style = _extends({}, props.style || {}, customStyle, colorStyle, commonProps);
  if (_props.typeConversion && _props.typeConversion !== 'Box') {
    replaceNode(_props.typeConversion);
  }
  return /*#__PURE__*/React.createElement(_Box, _props);
};
Div.displayName = 'Box';
export default Div;