<template>
  <SpaceButton
    class="back back-button"
    :class="{ disabled: disabled }"
    @click="emitClick"
  >
    <div class="icon">
      <SpIcon name="arrowLeft" />
    </div>
    <span>
      <slot />
    </span>
  </SpaceButton>
</template>

<script lang="ts">
import { defineComponent } from "vue";
export default defineComponent({
  props: {
    disabled: {
      default: false,
      type: Boolean,
    },
  },
  setup({ disabled }, { emit }) {
    const emitClick = (): void => {
      emit("click");
    };

    return {
      emitClick,
      disabled,
    };
  },
});
</script>
