<template>
  <ScrollContainer style="padding:10px">
    <div ref="wrapperRef" :class="prefixCls">
      <Tabs tab-position="left" :tabBarStyle="tabBarStyle">
        <template v-for="item in settingList" :key="item.key">
          <TabPane :tab="item.name">
            <component :is="item.component" />
          </TabPane>
        </template>
      </Tabs>
    </div>
  </ScrollContainer>
</template>

<script lang="ts">
  import { defineComponent } from 'vue';
  import { Tabs } from 'ant-design-vue';

  import { ScrollContainer } from '@jdlinker/ui';
  import { settingList } from './data';

  import BaseSetting from './BaseSetting.vue';
  import OSSSetting from './OSSSetting.vue';
  import MsgSetting from './MsgSetting.vue';
  import EmailSetting from './EmailSetting.vue';
  import SysConfig from './SysConfig.vue';

  export default defineComponent({
    components: {
      ScrollContainer,
      Tabs,
      TabPane: Tabs.TabPane,
      BaseSetting,
      OSSSetting,
      MsgSetting,
      EmailSetting,
      SysConfig
    },
    setup() {
      return {
        prefixCls: 'account-setting',
        settingList,
        tabBarStyle: {
          width: '150px'
        }
      };
    }
  });
</script>
<style lang="less" scoped>
  .account-setting {
    height: 100%;
    min-height: 770px;
    background-color: @component-background;

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

    .ant-tabs-tab-active {
      background-color: @item-active-bg;
    }
    .ant-tabs-content-holder {
      padding-left: 10px;
    }
  }
</style>
