<template>
  <span class="f10-icon" v-html="getSvgFromName(name)" />
</template>

<script>
import icons from "../index";

const component = {
  props: {
    name: String
  },
  methods: {
    getSvgFromName (name) {
      if (icons[name]) {
        return icons[name];
      } else {
        console.error(`F10 Icons does not have an icon named "${name}". Probably an icon name is typed incorrectly. Maybe something from admin is not configured correctly.`);
      }
    }
  }
};

export default component;
</script>
