import React from 'react';
import { Tabs } from '@wix/design-system';
import { observer } from 'mobx-react-lite';
import { ALL_TAB_ITEM_ID } from './types';
function _TabsDefault(props) {
    const { state, filter, selectedId, items, type, onChange, all } = props;
    const { itemKey } = filter;
    const { responsive } = state;
    return (React.createElement(Tabs, { minWidth: responsive.panelMinWidth, dataHook: "tabs-default", activeId: selectedId, onClick: (tab) => {
            const { id } = tab;
            const activeId = filter.isEmpty
                ? ALL_TAB_ITEM_ID
                : itemKey(filter.value[0]);
            const prevTab = items.find((item) => item.id === activeId);
            const values = id === ALL_TAB_ITEM_ID ? [] : [tab.value];
            state._reportTabSelectedBiOnNextResult({
                prevTab,
                nextTab: tab,
                items,
                hasAllTab: all != null,
            });
            onChange?.(values[0]);
            filter.refresh(values);
        }, type: type, items: items, hasDivider: false }));
}
export const TabsDefault = observer(_TabsDefault);
//# sourceMappingURL=TabsDefault.js.map