<template>
  <div class="panel-content panel-export-content">
    <div class="panel-content-item">
      <div class="button-c button-icon button-export" @click="SelectExport(1)">
        <i class="ico-c">
          <svg>
            <use :href="icourl + '#pdf'"></use>
          </svg>
        </i>
        <span class="panel-date">PDF</span>
      </div>
    </div>

    <div class="panel-content-item" v-if="showExport">
      <div class="button-c button-icon button-export" @click="SelectExport(2)">
        <i class="ico-c">
          <svg>
            <use :href="icourl + '#xls'"></use>
          </svg>
        </i>
        <span class="panel-date">Excell</span>
      </div>
    </div>

    <!-- <div class="panel-content-item" v-if="showExport">
      <div class="button-c button-icon button-export" @click="SelectExport(3)">
        <i class="ico-c">
          <svg>
            <use :href="icourl + '#csv'"></use>
          </svg>
        </i>
        <span class="panel-date">CSV</span>
      </div>
    </div> -->
  </div>
</template>
<script setup lang="ts">
  import { ref } from 'vue'
  import icourl from '@/assets/images/icons.svg'

  const props = defineProps<{
    selectedExport?: number | null
  }>()

  const emit = defineEmits(['update:selectedExport'])

  const selected = ref<number>(0)
  const showExport = ref<boolean>(true)

  const SelectExport = (exp: number) => {
    selected.value = exp
    emit('update:selectedExport', selected.value)
  }
</script>
