<!--
  Jovvix Quiz Application - QR Code Component
  
  Author: Molla Samser (Founder, RSK World)
  Designer & Tester: Rima Khatun
  Website: https://rskworld.in
  Contact: hello@rskworld.in | +91 93305 39277
  Address: Nutanhat, Mongolkote, Purba Burdwan, West Bengal, India, 713147
-->

<template>
  <div class="d-flex flex-column align-items-center">
    <qrcode-vue :value="qrUrl" :size="props.size" level="H" render-as="svg" />
  </div>
</template>
<script setup>
import QrcodeVue from "qrcode.vue";

const props = defineProps({
  scanURL: {
    type: String,
    required: true,
    default: "",
  },
  quizCode: {
    type: String,
    required: true,
    default: "",
  },
  size: {
    type: Number,
    required: false,
    default: 250,
  },
});

const qrUrl = computed(() =>
  props.quizCode ? `${props.scanURL}?code=${props.quizCode}` : props.scanURL
);
</script>
