import React, { useState } from 'react';
import { Tabs } from 'antd';
import { useIntl } from 'umi';
import BaseInfoTab from './component/BaseInfoTab';
import QualificationTab from './component/QualificationTab';
import InvoiceTab from './component/InvoiceTab';
import OtherAttachmentsTab from './component/OtherAttachmentsTab';
import ContactsInfoTab from './component/ContactsInfoTab';
import BankInfoTab from './component/BankInfoTab';



const { TabPane } = Tabs;

const CompanyInfo: React.FC = () => {
  const intl = useIntl();
  // 切换tab
  const [subTab, setSubTab] = useState<string>('base');

  return (
    <Tabs activeKey={subTab} onChange={setSubTab}>
      <TabPane tab={intl.formatMessage({ id: 'page.workbench.base' })} key="base">
        <BaseInfoTab />
      </TabPane>
      <TabPane tab={intl.formatMessage({ id: 'page.workbench.qualification' })} key="qualification">
        <QualificationTab />
      </TabPane>
      <TabPane tab={intl.formatMessage({ id: 'page.workbench.invoice' })} key="invoice">
        <InvoiceTab />
      </TabPane>
      <TabPane tab={intl.formatMessage({ id: 'page.workbench.bank' })} key="bank">
        <BankInfoTab />
      </TabPane>
      <TabPane tab={intl.formatMessage({ id: 'page.workbench.attachments' })} key="attachments">
        <OtherAttachmentsTab />
      </TabPane>
      <TabPane tab={intl.formatMessage({ id: 'page.workbench.contacts' })} key="contacts">
        <ContactsInfoTab />
      </TabPane>
    </Tabs>
  );
};

export default CompanyInfo;