<template>
  <div @click="toggleClick">
    <svg-icon
      :class="{'is-active':isActive}"
      style="height: 100%;"
      class="hamburger"
      :icon-class="iconName"
      @mouseover="mouseover"
      @mouseout="mouseout"
    />
  </div>
</template>

<script>
export default {
  name: 'Hamburger',
  props: {
    isActive: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {
      iconName: 'hide'
    }
  },
  methods: {
    mouseover() {
      this.iconName = 'open'
    },
    mouseout() {
      this.iconName = 'hide'
    },
    toggleClick() {
      this.$emit('toggleClick')
    }
  }
}
</script>

<style lang="less">
.hamburger.is-active {
  transform: rotate(180deg);
}
</style>
