import _extends from "@babel/runtime/helpers/extends";
import _defineProperty from "@babel/runtime/helpers/defineProperty";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["align", "backgroundColor", "border", "children", "className", "flex", "preventOverflow", "soft", "strong"];
import React from 'react';
import Box from '../box';
import cx from 'classnames';
import theme from './theme.css';
import uiUtilities from '@teamleader/ui-utilities';

var Cell = function Cell(_ref) {
  var _cx;

  var _ref$align = _ref.align,
      align = _ref$align === void 0 ? 'left' : _ref$align,
      backgroundColor = _ref.backgroundColor,
      border = _ref.border,
      children = _ref.children,
      className = _ref.className,
      _ref$flex = _ref.flex,
      flex = _ref$flex === void 0 ? 1 : _ref$flex,
      _ref$preventOverflow = _ref.preventOverflow,
      preventOverflow = _ref$preventOverflow === void 0 ? true : _ref$preventOverflow,
      _ref$soft = _ref.soft,
      soft = _ref$soft === void 0 ? false : _ref$soft,
      _ref$strong = _ref.strong,
      strong = _ref$strong === void 0 ? false : _ref$strong,
      others = _objectWithoutProperties(_ref, _excluded);

  var classNames = cx(uiUtilities['reset-font-smoothing'], theme['cell'], theme["align-".concat(align)], theme["flex-".concat(flex)], theme["has-background-".concat(backgroundColor)], theme["has-border-".concat(border)], (_cx = {}, _defineProperty(_cx, theme['is-soft'], soft), _defineProperty(_cx, theme['is-strong'], strong), _cx), className);
  return /*#__PURE__*/React.createElement(Box, _extends({
    className: classNames,
    "data-teamleader-ui": "datagrid-cell",
    boxSizing: "content-box"
  }, others), preventOverflow ? /*#__PURE__*/React.createElement("div", {
    className: theme['has-overflow-prevention']
  }, children) : children);
};

Cell.displayName = 'DataGrid.Cell';
export default Cell;