"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const tslib_1 = require("tslib");
const react_1 = tslib_1.__importDefault(require("react"));
const types_1 = require("../../types");
const Checkbox_1 = require("../../Checkbox");
function Header({ rows, search, selectedAllPeople, toggleAll, tableKey, checked, checkbox, border, spacing, textCenter, isHeaderBgWhite = false, }) {
    return (react_1.default.createElement(react_1.default.Fragment, null, rows.map((row, rowIdx) => (react_1.default.createElement("tr", { key: rowIdx, className: (0, types_1.classNames)(rowIdx !== 0 && border && 'border-t', search && search.enable && rowIdx === 0 && border && 'border-t') },
        selectedAllPeople && selectedAllPeople.enable && rowIdx === 0 && (react_1.default.createElement("th", { rowSpan: rows.length, className: (0, types_1.classNames)('text-center', isHeaderBgWhite ? 'bg-white' : 'bg-gray-50', border && 'border-r', search && search.enable ? '' : 'rounded-tl-lg') }, !(selectedAllPeople === null || selectedAllPeople === void 0 ? void 0 : selectedAllPeople.maxSelectedPeople) && (react_1.default.createElement("div", { className: 'flex justify-center items-center pl-3' },
            react_1.default.createElement(Checkbox_1.PHXCheckbox, { inputRef: checkbox, id: `${tableKey}-header`, onChange: toggleAll, checked: checked }))))),
        row.map((cell, cellIdx) => (react_1.default.createElement("th", { key: cellIdx, colSpan: cell.colSpan, rowSpan: cell.rowSpan, className: (0, types_1.classNames)('text-xs font-medium text-gray-800 whitespace-nowrap', isHeaderBgWhite ? 'bg-white' : 'bg-gray-50', textCenter ? 'text-center' : 'pl-8 text-left', spacing ? 'px-3 py-2.5' : '', cell.colIndex !== 0 && border && 'border-l', rowIdx === 0 && cellIdx === 0 && !(search === null || search === void 0 ? void 0 : search.enable) && !(selectedAllPeople === null || selectedAllPeople === void 0 ? void 0 : selectedAllPeople.enable) && 'rounded-tl-lg', rowIdx === 0 && cellIdx === row.length - 1 && !(search === null || search === void 0 ? void 0 : search.enable) && 'rounded-tr-lg') }, cell.name))))))));
}
exports.default = Header;
//# sourceMappingURL=Header.js.map