<script lang="ts" setup>
import {
  type IconName,
  icons,
} from '@/components/a-icon/iconfont.ts'
import '@/components/a-icon/iconfont.css'

const props = defineProps<{
  name?: IconName
}>()
const prefixText = icons.css_prefix_text
const fontFamily = icons.font_family
const icon = computed(() => {
  return props.name == null ? [] : [ fontFamily, prefixText + props.name ]
})
</script>

<template>
  <i :class="icon" v-bind="$attrs"/>
</template>
