"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
    return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.TableCell = void 0;
var react_1 = __importDefault(require("react"));
var classnames_1 = __importDefault(require("classnames"));
var helpers_1 = require("../../helpers");
var styles_1 = require("./styles");
var TableCell = function (_a) {
    var _b;
    var columnValue = _a.columnValue, rowData = _a.rowData, setHoveredColumn = _a.setHoveredColumn, resetHoveredColumn = _a.resetHoveredColumn, rowIsDragging = _a.rowIsDragging;
    var styles = (0, styles_1.useStyles)();
    var CellRenderer = rowData.cellRenderer || helpers_1.DefaultCellRenderer;
    var onMouseOver = setHoveredColumn ? function () { return setHoveredColumn(columnValue); } : undefined;
    return (react_1.default.createElement("td", { onMouseOver: onMouseOver, onMouseLeave: resetHoveredColumn },
        react_1.default.createElement("div", { className: (0, classnames_1.default)((_b = {}, _b[styles.hidden] = rowIsDragging, _b)) },
            react_1.default.createElement(CellRenderer, { value: columnValue[rowData.id] }))));
};
exports.TableCell = TableCell;
