<script setup lang="ts">
import { computed } from 'vue'
import './svgIcon.less'

const props = defineProps({
	iconClass: {
		type: String,
		required: true
	},
	className: {
		type: String,
		default: ''
	},
	iconColor: {
		type: String,
		default: 'CurrentColor'
	}
})
const iconName = computed(() => `#icon-${props.iconClass}`)
const svgClass = computed(() => {
	if (props.className) {
		return 'icons-icon ' + props.className
	} else {
		return 'svg-icon'
	}
})
</script>
<template>
	<svg :class="svgClass" aria-hidden="true" :fill="iconColor">
		<use :xlink:href="iconName" />
	</svg>
</template>
