import * as React from "react";
import * as PropTypes from "prop-types";
import * as tablePropTypes from "./tablePropTypes";
import Column from "./Column";
import HeaderCell from "./HeaderCell";
import MorePropTypes from "../utils/MorePropTypes";
export var cssClass = {
    ROW: "Table--header--row",
    SORTABLE: "Table--header--cell--sortable",
};
export default function Header(_a) {
    var children = _a.children, disableSort = _a.disableSort, onSortChange = _a.onSortChange, sortState = _a.sortState, selectable = _a.selectable;
    return (React.createElement(React.Fragment, null, children.map(function (_a) {
        var column = _a.props;
        return (React.createElement(HeaderCell, { activeSortDirection: sortState.columnID === column.id ? sortState.direction : null, className: column.header && column.header.className, key: column.id, onSortChange: function () { return onSortChange(column.id); }, sortable: column.sortable && !disableSort, width: column.width }, column.header && column.header.content));
    })));
}
Header.propTypes = {
    children: PropTypes.arrayOf(MorePropTypes.instanceOfComponent(Column)),
    disableSort: PropTypes.bool,
    onSortChange: PropTypes.func,
    sortState: tablePropTypes.sortState,
};
Header.defaultProps = {
    sortState: {},
};
