import React, { useState } from 'react';
import { Tabs } from 'antd';

import WordTemplate from './Component/WordTemplate';
import TemplateCURD from './Component/TemplateCURD';
import ConstraintDetail from './Component/ConstraintDetail';
import PartitionCURD from './Component/PartitionCURD';

import './index.less';

const { TabPane } = Tabs;

const ModelConfig = () => {
  const [ tabKey, setTabKey ] = useState('1');

  const onTabChange = (key) => {
    setTabKey(key);
  }

  return (
    <div className='model-config'>
      <Tabs activeKey={tabKey} onChange={onTabChange}>
        <TabPane tab='Word模版配置' key='1'>
          <WordTemplate />
        </TabPane>
        <TabPane tab='生成表类型配置' key='2'>
          <TemplateCURD />
        </TabPane>
        <TabPane tab='规范配置' key='3'>
          <ConstraintDetail />
        </TabPane>
        <TabPane tab='分区配置' key='4'>
          <PartitionCURD />
        </TabPane>
      </Tabs>
    </div>
  )
}

export default ModelConfig;