{"ast":null,"code":"import { jsx as _jsx } from \"react/jsx-runtime\";\nimport { jsxs as _jsxs } from \"react/jsx-runtime\";\nimport { Fragment as _Fragment } from \"react/jsx-runtime\";\nimport Tabs from 'components/tabs/Tabs';\nimport { useEffect, useState } from 'react';\n\nconst TabsSlice = ({\n  tabs,\n  defaultTab\n}) => {\n  const {\n    0: currentTabKey,\n    1: setCurrentTabKey\n  } = useState('both');\n\n  const onSwitchTab = tabKey => setCurrentTabKey(tabKey);\n\n  useEffect(() => {\n    if (currentTabKey == 'init') {\n      setCurrentTabKey(defaultTab || 'list');\n    }\n  }, [currentTabKey]);\n  return /*#__PURE__*/_jsxs(_Fragment, {\n    children: [/*#__PURE__*/_jsx(Tabs, {\n      items: tabs,\n      onChange: onSwitchTab\n    }), tabs.map(tab => currentTabKey == 'init' || currentTabKey == tab.key ? tab.render(tab.key) : null)]\n  });\n};\n\nexport default TabsSlice;","map":null,"metadata":{},"sourceType":"module"}