"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.Tabs = void 0;
const tslib_1 = require("tslib");
const classnames_1 = tslib_1.__importDefault(require("classnames"));
const react_1 = tslib_1.__importDefault(require("react"));
require("./style.less");
const Tabs = (props) => {
    const { tabs, className, value, onChange, mini, style, ...restProps } = props;
    const onClick = react_1.default.useCallback((index) => {
        if (typeof onChange === 'function') {
            onChange(index);
        }
    }, []);
    return (react_1.default.createElement("div", { ...restProps, style: style, className: (0, classnames_1.default)('kt-tabs', className, { ['kt-tabs-mini']: mini }) }, tabs.map((tabContent, i) => {
        const selectedClassName = i === value ? 'kt-tab-selected' : '';
        if (typeof tabContent === 'string') {
            return (react_1.default.createElement("div", { key: i, className: (0, classnames_1.default)('kt-tab', selectedClassName, { ['kt-mini-tab']: mini }), onClick: onClick.bind(null, i) }, tabContent));
        }
        return (react_1.default.createElement("div", { key: i, className: (0, classnames_1.default)('kt-custom-tab', selectedClassName, { ['kt-mini-tab']: mini }), onClick: onClick.bind(null, i) }, tabContent));
    })));
};
exports.Tabs = Tabs;
//# sourceMappingURL=index.js.map