<template>
  <div class="app-container" :style="{height: containerMaxHeight}">
    <DocumentPreview :url="url" height="100%" width="100%" fileType="pdf" />
  </div>
</template>

<script>
import DocumentPreview from '@/components/DocumentPreview/index.vue'
import {getQuotationPDF} from '@/api/business/quotation/quotation.js'

export default {
  name: 'Preview',
  components: {
    DocumentPreview
  },
  data() {
    return {
      url: '',
    }
  },
  computed: {
    containerMaxHeight() {
      return (this.$store.getters.containerMaxHeight - 48) + 'px'
    }
  },
  created(){
    getQuotationPDF(this.$route.query.id).then(url => this.url = url)
  }

}
</script>

<style lang="scss" scoped>


</style>
