import { MyPageContainer } from '@/common';
import { Tabs } from 'antd';
import { useState } from 'react';
import Borrows from './borrows';
import Read from './read';
export default function Index({ title = '合同档案借用' }) {
  const [activeKey, setActiveKey] = useState('Borrows');
  const items = [
    {
      key: 'Borrows',
      label: '合同借用',
      children: <Borrows />,
    },
    {
      key: 'Read',
      label: '合同借阅',
      children: <Read />,
    },
  ];

  return (
    <MyPageContainer
      title={title}
      enableTabs={true}
      tabKey="contract_borrows"
      tabLabel={title}
    >
      <Tabs
        type="card"
        activeKey={activeKey}
        items={items}
        onChange={(key) => {
          setActiveKey(key);
        }}
      />
    </MyPageContainer>
  );
}
