import _extends from "@babel/runtime/helpers/extends";
import _objectWithoutProperties from "@babel/runtime/helpers/objectWithoutProperties";
var _excluded = ["className", "children", "sliceFrom", "sliceTo", "preserveSelectableSpace"];
import React, { forwardRef } from 'react';
import Cell from './Cell';
import Row from './Row';
import cx from 'classnames';
import theme from './theme.css';
var FooterRow = /*#__PURE__*/forwardRef(function (_ref, ref) {
  var className = _ref.className,
      children = _ref.children,
      sliceFrom = _ref.sliceFrom,
      sliceTo = _ref.sliceTo,
      preserveSelectableSpace = _ref.preserveSelectableSpace,
      others = _objectWithoutProperties(_ref, _excluded);

  var childrenArray = Array.isArray(children) ? children : [children];
  var childrenSliced = childrenArray.slice(sliceFrom, sliceTo);
  var classNames = cx(theme['footer-row'], className);
  return /*#__PURE__*/React.createElement(Row, _extends({
    className: classNames,
    "data-teamleader-ui": "datagrid-footer-row",
    ref: ref
  }, others), preserveSelectableSpace && /*#__PURE__*/React.createElement(Cell, {
    flex: "checkbox-width",
    preventOverflow: false
  }), childrenSliced);
});
FooterRow.displayName = 'DataGrid.FooterRow';
export default FooterRow;