<template>
  <svg aria-hidden="true" class="svg-icon">
    <use :xlink:href="symbolId" :fill="color" />
  </svg>
</template>

<script setup name="SvgIcon">
import { computed } from 'vue';

const props = defineProps({
  prefix: {
    type: String,
    default: 'icon-icon',
  },
  name: {
    type: String,
    required: true,
  },
  color: {
    type: String,
    default: '#4E5969',
    // active:#165DFF
  },
});

const symbolId = computed(() => `#${props.prefix}-${props.name}`);
</script>

<style lang="less">
.svg-icon {
  display: inline-block;
  vertical-align: middle;
  width: 16px;
  height: 16px;
}
</style>
