<script setup>
import { computed } from "vue";

let props = defineProps({
  name: {
    type: String,
    required: false,
  },
  prefix: {
    type: String,
    default: "icon",
  },
  color: {
    type: String,
    default: "#000",
  },
  size: {
    type: String,
    default: "22",
  },
});

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

<template>
  <svg
    aria-hidden="true"
    class="el-icon"
    :style="{ 'width': size + 'px', 'height': size + 'px', 'fill': color }"
  >
    <use :xlink:href="symbolId" :fill="color" />
  </svg>
</template>

<style lang="scss" scoped>
.svg-icon {
  width: 100%;
  height: 100%;
}
</style>
