import React from 'react';
import TabsCommon from './tabs-common';
import TabsExpand from './tabs-expand';
import TabsNumber from './tabs-number';
import TabsScroll from './tabs-scroll';
import TabsHub from './tabs-hub';
import connect from "../connect";

export interface Props {
  type:
    | 'common' // 普通tabs
    | 'scroll' // 滚动tabs
    | 'expand' // 下拉tabs
    | 'number' // 带数字tabs
    | 'hub'; // tabsHub
}

/**
 * 标签列表
 */
const Tabs: React.FC<Props> = ({ type, ...otherProps }) => {
  if (type === 'common') return <TabsCommon {...otherProps} />;
  if (type === 'scroll') return <TabsScroll {...otherProps} />;
  if (type === 'expand') return <TabsExpand {...otherProps} />;
  if (type === 'number') return <TabsNumber {...otherProps} />;
  if (type === 'hub') return <TabsHub {...otherProps} />;
  return null;
};

export default connect(Tabs, {}, {
  'common': (TabsCommon as any).default,
  'scroll': (TabsScroll as any).default,
  'expand': (TabsExpand as any).default,
  'number': (TabsNumber as any).default,
  'hub': (TabsHub as any).default,
});
