import { extends as _extends } from '../../../../_virtual/_rollupPluginBabelHelpers.js';
import React__default from 'react';
import { flexRender } from '@tanstack/react-table';
import { Resizer } from '../../Table.styles.js';
import { Td } from './Cell.styles.js';
import { SELECT_COLUMN_ID } from '../../utils/constants.js';

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.createElement(Td, _extends({
    key: cell.id,
    borderVariant: borderVariant,
    selectionCell: cell.column.id === SELECT_COLUMN_ID,
    selected: selected,
    view: view,
    className: className
  }, additionalProps), renderCell ? renderCell(cell.getValue(), cell.row.original, cell.row.index) : flexRender(cell.column.columnDef.cell, cell.getContext()), cell.column.getIsResizing() && (_Resizer || (_Resizer = /*#__PURE__*/React__default.createElement(Resizer, {
    isResizing: true
  }))));
};

export { Cell };
