import { _ as __assign } from '../tslib.es6-20a2a300.js';
import { jsx, jsxs } from 'react/jsx-runtime';
import TableSortLabel from './TableSortLabel.js';
import { b as MuiTableHead, M as MuiTableRow, a as MuiTableCell } from '../TableRow-b30398d4.js';
import './TableSortLabelIcon.js';
import './Icon.js';
import '../icons/ArrowRight.js';
import '../icons/ArrowRightCircle.js';
import '../icons/Check.js';
import '../icons/CheckCircle.js';
import '../icons/ChevronRight.js';
import '../icons/CrossCircle.js';
import '../icons/DollarSign.js';
import '../icons/InfoCircle.js';
import '../icons/Link.js';
import '../icons/TriangleUp.js';
import '../icons/TriangleDown.js';
import '../icons/TriangleLeft.js';
import '../icons/Copy.js';
import '../icons/SortUp.js';
import '../icons/Cross.js';
import '../icons/Search.js';
import '../icons/Range.js';
import '../theme/colors.js';
import '../makeStyles-c9a99c7a.js';
import '../defaultTheme-49a26576.js';
import 'react';
import '../createStyles-16423e9e.js';
import '../Box-581dc061.js';
import '../styled-339d0187.js';
import '../clsx.m-6243b874.js';
import '../hoist-non-react-statics.cjs-b718ab87.js';
import '../createSvgIcon-6fb7d1b7.js';
import '../withStyles-99aeb25b.js';
import '../capitalize-5d3e9aac.js';
import '../ButtonBase-11d3cdb5.js';
import 'react-dom';
import '../useForkRef-4ff8cc89.js';
import '../useEventCallback-8817ed1c.js';
import '../deprecatedPropType-0232df1e.js';
import '../useIsFocusVisible-c048447c.js';
import '../TransitionGroupContext-2ba64e99.js';
import '../refType-5cc24a92.js';
import '../elementTypeAcceptingRef-7677eeee.js';

var TableHeadSort = function (_a) {
    var headCells = _a.headCells, order = _a.order, orderBy = _a.orderBy, onRequestSort = _a.onRequestSort;
    var createSortHandler = function (property) { return function (event) {
        onRequestSort(event, property);
    }; };
    return (jsx(MuiTableHead, { children: jsx(MuiTableRow, { children: headCells.map(function (headCell) { return (jsxs(MuiTableCell, __assign({ sortDirection: orderBy === headCell.id ? order : false }, headCell.props, { children: [headCell.sortable && (jsx(TableSortLabel, __assign({ active: orderBy === headCell.id, direction: orderBy === headCell.id ? order : "asc", onClick: createSortHandler(headCell.id) }, { children: headCell.label }), void 0)), !headCell.sortable && headCell.label] }), headCell.id)); }) }, void 0) }, void 0));
};

export { TableHeadSort as default };
