<template>
  <div class="vab-logo">
    <router-link to="/" class="logo-url">
      <img v-if="collapse" src="../../assets/logo.png" width="30" />
      <img v-else src="../../assets/logo_admin.png" />
    </router-link>
    <span class="anticon"></span>
    <span>{{ title }}</span>
  </div>
</template>

<script>
import { computed } from 'vue'
import { useStore, mapGetters } from 'vuex'

export default {
  name: 'VabLogo',
  computed: {
    ...mapGetters({
      collapse: 'settings/collapse',
      routes: 'routes/routes',
      device: 'settings/device',
    }),
  },
  setup() {
    const store = useStore()
    return {
      collapsed: false,
      logo: computed(() => store.getters['settings/logo']),
      title: computed(() => store.getters['settings/title']),
    }
  },
}
</script>
<style lang="less" scoped>
.vab-logo {
  text-align: center;
  margin: 10px 5px;
}
</style>
