<template>
  <component :is="dynamicComponent" />
</template>

<script setup>
import { defineProps, computed, defineAsyncComponent } from 'vue'

const props = defineProps({
  name: {
    type: String,
    required: true
  }
})

const dynamicComponent = computed(() => {
  return defineAsyncComponent(() =>
    import(`../assets/svg/${props.name}.svg`)
  )
})
</script>