<template>
  <div class="svg-button" @click="buttonClick">
    <svg-icon :icon-class="icon" :style="svgStyle" />
    <span class="name">
      <slot />
    </span>
  </div>
</template>

<script>
export default {
  props: {
    icon: {
      type: String,
      default: ''
    },
    svgStyle: {
      type: Object,
      default: () => ({
        width: '24px',
        height: '24px'
      })
    }
  },
  methods: {
    buttonClick() {
      this.$emit('click')
    }
  }
}
</script>

<style lang="scss" scoped>
.svg-button {
  display: flex;
  align-items: center;
  cursor: pointer;
  .name {
    margin-left: 5px;
    font-size: 16px;
    color: #222931;
  }
}
</style>
