<template>
  <div class="btn-with-switch-icon">
    <i @click="handleClick('left')">
      <img src="@/assets/images/spectrum/left-arrow.png" />
    </i>
    <span>
      <slot></slot>
    </span>
    <i @click="handleClick('right')">
      <img src="@/assets/images/spectrum/right-arrow.png" />
    </i>
  </div>
</template>

<script>
export default {
  methods: {
    handleClick(direction) {
      this.$emit('change', direction)
    }
  }
}
</script>

<style lang="less" scoped>
.btn-with-switch-icon {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border: 1px solid #0a544e;
  padding: 0 4px;
  height: 100%;
  letter-spacing: 1px;
  color: #ade6ee;
  user-select: none;

  i {
    cursor: pointer;
    width: 16px;
    text-align: center;
  }

  span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
}
</style>
