import { jsx as _jsx } from "react/jsx-runtime";
import { cn } from '../../../scalars/lib/utils.js';
import { useInternalTableState } from '../table-provider/table-provider.js';
import { TableCellBasic } from './basic-cell.js';
const RowNumberCell = ({ index, handleSelectRowOnClick, selected, hasErrors }) => {
    const { config: { showRowNumbers, allowRowSelection, minRowHeight }, } = useInternalTableState();
    if (!showRowNumbers && !allowRowSelection) {
        // if allow selection is enabled we need to show the row anyways
        // to allow the user to select the row
        return null;
    }
    return (_jsx(TableCellBasic, { className: cn('select-none border-r border-gray-300 text-center', allowRowSelection && 'cursor-pointer', selected && !hasErrors && 'bg-blue-900 text-white'), onClick: handleSelectRowOnClick, children: _jsx("div", { className: "flex flex-1 items-center justify-center py-4", style: { minHeight: minRowHeight }, children: showRowNumbers ? index : '' }) }));
};
export { RowNumberCell };
//# sourceMappingURL=row-number-cell.js.map