import { jsx as _jsx } from "react/jsx-runtime";
import { cn } from "#scalars";
import { useInternalTableState } from "../table-provider/table-provider.js";
import { TableCellBasic } from "./basic-cell.js";
const RowNumberCell = ({ index, handleSelectRowOnClick, selected, }) => {
    const { config: { showRowNumbers, allowRowSelection }, } = 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("min-w-9 select-none border-r border-gray-300 text-center", allowRowSelection && "cursor-pointer", selected && "bg-blue-900 text-white"), onClick: handleSelectRowOnClick, children: showRowNumbers ? index : "" }));
};
export { RowNumberCell };
//# sourceMappingURL=row-number-cell.js.map