<template>
  <span class="zpa-row middle ToggleMenu center no-fit" :class="classes">
    <Icon :type="toggleMenuIcon" :size="32" color="#fff" @click="toggle"></Icon>
  </span>
</template>

<script>
export default {
  name: 'ToggleMenu',
  props: {
    value: Boolean,
    theme: String,
  },
  computed: {
    toggleMenuIcon () {
      return this.value ? 'md-arrow-forward' : 'md-arrow-back'
    },
    classes () {
      if (!this.theme) return {}

      return {
        [this.theme]: true,
      }
    },
  },
  methods: {
    toggle () {
      this.$emit('input', !this.value)
    }
  },
}
</script>

<style scoped lang="less">
.ToggleMenu {
  width: 64px;
  height: 64px;
  background: #9061f9;
  margin-right: 16px;
  cursor: pointer;
}
</style>
