import React, { useMemo, useState } from 'react';
import { UdpTabs } from './UdpTabs';
import { UdpTabPanel } from './UdpTabPanel';
export const UdpTabUtility = (props) => {
    const { tabList, menuWidth, menuMaxHeight, menuItemProps, variant } = props;
    const [selectedTab, setSelectedTab] = useState(0);
    const currentTabList = useMemo(() => {
        return tabList === null || tabList === void 0 ? void 0 : tabList.map((tab, index) => (Object.assign({ id: index }, tab)));
    }, [tabList]);
    return (React.createElement("div", null, React.createElement(UdpTabs, { value: selectedTab, onChange: (e, value) => {
            setSelectedTab(value);
        }, tabList: currentTabList, menuItemProps: menuItemProps, menuWidth: menuWidth, menuMaxHeight: menuMaxHeight, variant: variant }), currentTabList === null || currentTabList === void 0 ? void 0 : currentTabList.map((tab) => (React.createElement(UdpTabPanel, { key: tab === null || tab === void 0 ? void 0 : tab.id, index: tab === null || tab === void 0 ? void 0 : tab.id, value: selectedTab }, tab === null || tab === void 0 ? void 0 : tab.child)))));
};
//# sourceMappingURL=UdpTabUtility.js.map