var __assign = (this && this.__assign) || function () {
    __assign = Object.assign || function(t) {
        for (var s, i = 1, n = arguments.length; i < n; i++) {
            s = arguments[i];
            for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
                t[p] = s[p];
        }
        return t;
    };
    return __assign.apply(this, arguments);
};
import React, { useCallback } from 'react';
import ConfigProvider from '../../../config-provider';
import Icon from '../../icon';
function CardCollapsableHead(_a) {
    var collapsed = _a.collapsed, onCollapsedChange = _a.onCollapsedChange, _b = _a.prefix, prefix = _b === void 0 ? 'next-' : _b, _c = _a.children, children = _c === void 0 ? '标题' : _c;
    var handleCollapsedChange = useCallback(function () {
        onCollapsedChange === null || onCollapsedChange === void 0 ? void 0 : onCollapsedChange(!collapsed);
    }, [collapsed, onCollapsedChange]);
    // eslint-disable-next-line
    return (React.createElement("div", __assign({}, {
        className: "".concat(prefix, "card-collapsable-head"),
        onClick: handleCollapsedChange,
    }),
        children,
        collapsed ? React.createElement(Icon, { type: "3212" }) : React.createElement(Icon, { type: "3213" })));
}
export default ConfigProvider.config(CardCollapsableHead);
