<script setup lang="ts">
import { storeToRefs } from "pinia";
import { useReportStore } from "@/store";
import { onMounted } from "vue";
// import { downloadScreenshotFn, downloadPDF } from "@/utils";

const reportStore = useReportStore();
const { pageList } = storeToRefs(reportStore);

onMounted(() => {
  setTimeout(() => {
    // todo
    // downloadPDF("screenshot");
    // downloadScreenshotFn("screenshot");
  }, 1000);
});
</script>

<template>
  <div id="screenshot">
    <div v-for="page in pageList" :key="page.id" class="item">
      <Component :is="cpt.view" v-for="cpt in page.componentList" :key="cpt.id" :value="cpt.value" />
    </div>
  </div>
</template>

<style scoped lang="scss">
#screenshot {
  position: fixed;
  top: -200vw;
  left: -200vh;
  //top: 0;
  //left: 0;
  width: 100vw;

  .item {
    overflow: hidden;
  }
}
</style>
