<script setup>
import { onMounted } from "vue";
import { useApiRequestStore } from "@/stores/ApiRequestStore";
import Loading from "@/components/Loading.vue";

const { getPdf } = useApiRequestStore();

const shipmentIds = window.gcargo.print_data;

onMounted(async () => {
  if (shipmentIds) {
    window.location.href = await getPdf({ data: { shipments: shipmentIds } });
  }
});
</script>
<template>
  <Loading />
  <div class="flex h-screen w-full items-center justify-center">
    <div class="text-3xl font-semibold text-primary-600">
      Barkodlar hazırlanıyor...
    </div>
  </div>
</template>
