<template>
  <ScrollContainer>
    <div ref="wrapperRef" :class="prefixCls">
      <Tabs tab-position="left" :tabBarStyle="tabBarStyle">
        <template v-for="item in settingList" :key="item.key">
          <TabPane :tab="item.name">
            <div :style="'display: flex; height:' + data.height">
              <component :is="tabs[item.component]" />
            </div>
          </TabPane>
        </template>
      </Tabs>
    </div>
  </ScrollContainer>
</template>

<script lang="ts" setup>
  import { reactive } from 'vue';
  import { Tabs } from 'ant-design-vue';
  import { ScrollContainer } from '@/components/Container';
  import { settingList } from './data';

  import { CreateFlow } from './page';
  import { UncompletedTask } from './page';
  import { CompletedTask } from './page';
  import { MyTask } from './page';
  import { ReadTask } from './page';
  import { MyDraft } from './page';
  import { DelegateTask } from './page';

  const TabPane = Tabs.TabPane;
  const tabs = {
    CreateFlow,
    UncompletedTask,
    CompletedTask,
    MyTask,
    ReadTask,
    MyDraft,
    DelegateTask,
  };
  const data = reactive({
    height: document.documentElement.clientHeight - 104.5 + 'px;',
  });

  const prefixCls = 'account-setting';
  const tabBarStyle = {
    width: '220px',
  };
</script>
<style lang="less" scoped>
  .account-setting {
    margin: 12px;
    background-color: @component-background;

    .base-title {
      padding-left: 0;
    }

    .ant-tabs-tab-active {
      background-color: @item-active-bg;
    }
  }
</style>
