import React from 'react';
import { classNames } from '../../types';
import { PHXCheckbox } from '../../Checkbox';
function Header({ rows, search, selectedAllPeople, toggleAll, tableKey, checked, checkbox, border, spacing, textCenter, isHeaderBgWhite = false, }) {
    return (React.createElement(React.Fragment, null, rows.map((row, rowIdx) => (React.createElement("tr", { key: rowIdx, className: classNames(rowIdx !== 0 && border && 'border-t', search && search.enable && rowIdx === 0 && border && 'border-t') },
        selectedAllPeople && selectedAllPeople.enable && rowIdx === 0 && (React.createElement("th", { rowSpan: rows.length, className: 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.createElement("div", { className: 'flex justify-center items-center pl-3' },
            React.createElement(PHXCheckbox, { inputRef: checkbox, id: `${tableKey}-header`, onChange: toggleAll, checked: checked }))))),
        row.map((cell, cellIdx) => (React.createElement("th", { key: cellIdx, colSpan: cell.colSpan, rowSpan: cell.rowSpan, className: 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))))))));
}
export default Header;
//# sourceMappingURL=Header.js.map