<template>
  <Tooltip :title="getTitle" placement="bottom" :mouseEnterDelay="0.5">
    <span @click="toggle">
      <!-- <FullscreenOutlined v-if="!isFullscreen" />
      <FullscreenExitOutlined v-else /> sjl-->
      <img :src="qp1" v-if="!isFullscreen" alt="" srcset="" style="width: 26px;height: 26px;">
      <img :src="qp2" v-else alt="" srcset="" style="width: 26px;height: 26px;">
    </span>
  </Tooltip>
</template>
<script lang="ts">
import { defineComponent, computed, unref } from 'vue';
import { Tooltip } from 'ant-design-vue';
import { useI18n } from '/@/hooks/web/useI18n';
import { useFullscreen } from '@vueuse/core';
import qp1 from '/@/assets/images/qp1.svg';
import qp2 from '/@/assets/images/qp2.svg';

import { FullscreenExitOutlined, FullscreenOutlined } from '@ant-design/icons-vue';
export default defineComponent({
  name: 'FullScreen',
  components: { FullscreenExitOutlined, FullscreenOutlined, Tooltip },

  setup() {
    const { t } = useI18n();
    const { toggle, isFullscreen } = useFullscreen();

    const getTitle = computed(() => {
      return unref(isFullscreen)
        ? t('layout.header.tooltipExitFull')
        : t('layout.header.tooltipEntryFull');
    });

    return {
      qp1,
      qp2,
      getTitle,
      isFullscreen,
      toggle,
    };
  },
});
</script>
