<script setup lang="ts">
import SvgIcon from "@/components/SvgIcon/index.vue";
import { storeToRefs } from "pinia";
import { useAppStore } from "@/store/modules/app";

const appStore = useAppStore();
const { device } = storeToRefs(appStore); // 设备类型：desktop-宽屏设备 || mobile-窄屏设备
/**
 * vueUse 全屏
 */
const { isFullscreen, toggle } = useFullscreen();
</script>

<template>
  <!-- 导航栏设置(窄屏隐藏)-->
  <div v-if="device !== 'mobile'" class="setting-container">
    <!--全屏 -->
    <div class="setting-item" @click="toggle">
      <svg-icon
        :icon-class="isFullscreen ? 'exit-fullscreen' : 'fullscreen'"
        size="16px"
      />
    </div>
  </div>
</template>

<style scoped lang="scss">
.setting-container {
  display: flex;
  align-items: center;
  .setting-item {
    display: inline-block;
    width: 30px;
    height: 70px;
    line-height: 70px;
    color: #5a5e66;
    text-align: center;
    cursor: pointer;
    &:hover {
      background: rgb(249 250 251 / 100%);
    }
  }
}
</style>
