<template>
  <div class="gl-page-content-grey-full">
    <div class="content">
      <div class="page-title">
        <el-tabs v-model="currentTab" type="card">
          <el-tab-pane :label="$t('系统管理.存储统计')" name="Storage statistics" />
          <el-tab-pane :label="$t('系统管理.存储设置')" name="Storage Settings" />
          <el-tab-pane :label="$t('系统管理.文件管理')" name="Document Management" />
        </el-tabs>
      </div>
      <div class="page-content">
        <keep-alive>
          <component :is="currentComponent"></component>
        </keep-alive>
      </div>
    </div>
  </div>
</template>

<script lang="ts" setup>
import { ref, computed } from 'vue';
import storageStatistics from './components/storageStatistics/index.vue';
import storageSettings from './components/storageSettings/index.vue';
import documentManagement from './components/documentManagement/index.vue';

type TabType = 'Storage statistics' | 'Storage Settings' | 'Document Management';
const currentTab = ref<TabType>('Storage statistics');

const componentsMap = {
  'Storage statistics': storageStatistics,
  'Storage Settings': storageSettings,
  'Document Management': documentManagement,
};
const currentComponent = computed(() => componentsMap[currentTab.value]);
</script>

<style lang="scss" scoped>
.gl-page-content-grey-full {
  .content {
    height: 100%;
    height: 100%;
    background-color: var(--el-bg-color);
    padding: 10px;
    .page-title {
      width: 100%;
      height: 50px;
    }
    .page-content {
      width: 100%;
      height: calc(100% - 50px);
    }
  }
}
</style>
