'use strict';

Object.defineProperty(exports, '__esModule', { value: true });

var _rollupPluginBabelHelpers = require('../../../../_virtual/_rollupPluginBabelHelpers.js');
var React = require('react');
var reactTable = require('@tanstack/react-table');
var Table_styles = require('../../Table.styles.js');
var Cell_styles = require('./Cell.styles.js');
var constants = require('../../utils/constants.js');

function _interopDefault (e) { return e && e.__esModule ? e : { default: e }; }

var React__default = /*#__PURE__*/_interopDefault(React);

var _Resizer;
var Cell = function Cell(_ref) {
  var _cell$column$columnDe;
  var cell = _ref.cell,
    borderVariant = _ref.borderVariant,
    selected = _ref.selected,
    view = _ref.view,
    additionalProps = _ref.additionalProps,
    className = _ref.className;
  var renderCell = (_cell$column$columnDe = cell.column.columnDef.meta) === null || _cell$column$columnDe === void 0 ? void 0 : _cell$column$columnDe.renderCell;
  return /*#__PURE__*/React__default.default.createElement(Cell_styles.Td, _rollupPluginBabelHelpers.extends({
    key: cell.id,
    borderVariant: borderVariant,
    selectionCell: cell.column.id === constants.SELECT_COLUMN_ID,
    selected: selected,
    view: view,
    className: className
  }, additionalProps), renderCell ? renderCell(cell.getValue(), cell.row.original, cell.row.index) : reactTable.flexRender(cell.column.columnDef.cell, cell.getContext()), cell.column.getIsResizing() && (_Resizer || (_Resizer = /*#__PURE__*/React__default.default.createElement(Table_styles.Resizer, {
    isResizing: true
  }))));
};

exports.Cell = Cell;
