import { MyPageContainer, useCurrentPermissions } from '@/common';
import type { TabsProps } from 'antd';
import { Tabs } from 'antd';
import Audit from './audit';
import List from './list';
export default function Index({ title = '账单' }) {
  const getCurrentPermissions = useCurrentPermissions();

  const items: TabsProps['items'] = getCurrentPermissions({
    AllBillsList: {
      key: 'bills',
      label: '账单',
      children: <List />,
    },
    AllBillsAudit: {
      key: 'audit',
      label: '审核',
      children: <Audit />,
    },
  });
  return (
    <MyPageContainer
      title={title}
      enableTabs={true}
      tabKey="renovation_applies"
      tabLabel={title}
    >
      <Tabs type="card" items={items} />
    </MyPageContainer>
  );
}
