<script setup lang="ts">
import { ref } from "vue";

/** importComponents*/
import DialogHeader from "@/components/DialogHeader.vue";
import ViewPDF from "@/modules/12_evaluatePersonal/components/Detail/viewstep/viewPDF.vue";

/** importStore*/
import { useEvaluateDetailStore } from "@/modules/12_evaluatePersonal/store/EvaluateDetail";

/** use*/
const store = useEvaluateDetailStore();

const modalPerview = ref<boolean>(false);
</script>

<template>
  <div class="col-12 row">
    <q-space />
    <q-btn
      flat
      round
      color="primary"
      icon="download"
      target="_blank"
      :href="store.urlDownloadFile"
    >
      <q-tooltip>ดาวน์โหลด</q-tooltip>
    </q-btn>
    <q-btn
      flat
      round
      color="primary"
      icon="mdi-fullscreen"
      @click="modalPerview = true"
      ><q-tooltip>ดูเต็มจอ</q-tooltip></q-btn
    >
  </div>

  <ViewPDF />

  <q-dialog v-model="modalPerview" full-width fullHeight>
    <q-card>
      <q-card-section>
        <DialogHeader :close="() => (modalPerview = false)" />
      </q-card-section>

      <q-card-section class="q-pt-none">
        <ViewPDF :type="'popup'" />
      </q-card-section>
    </q-card>
  </q-dialog>
</template>

<style scoped></style>
