<template>
  <ProConfigProvider
    :theme="{
      algorithm: [compactAlgorithm],
    }"
  >
    <Suspense>
      <router-view v-slot="{ Component }">
        <transition>
          <keep-alive v-if="route.meta.keepAlive">
            <component :is="Component" v-if="route.meta.keepAlive" :key="route.path" />
          </keep-alive>
          <component :is="Component" v-else :key="route.path" />
        </transition>
      </router-view>
    </Suspense>
    <LockScreen />
  </ProConfigProvider>
</template>

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

  import { LockScreen } from '@/components/basic/lockscreen';
  import { useRoute } from 'vue-router';

  const route = useRoute();

  const { compactAlgorithm } = theme;
</script>
