<template>
  <div class="ws-back-label">
    <router-link
      v-if="to"
      class="ws-back-label__link"
      :to="to"
    >
      <v-icon
        color="link"
        size="24"
      >mdi-chevron-left</v-icon>
      <p class="link--text">{{label}}</p>
    </router-link>
    <a
      v-else
      class="ws-back-label__link"
      @click="$emit('click')"
    >
      <v-icon
        color="link"
        size="24"
      >mdi-chevron-left</v-icon>
      <p class="link--text">{{label}}</p>
    </a>
  </div>
</template>

<script>
export default {
  props: {
    to: {
      type: String,
      default: null
    },
    label: {
      type: String,
      default: null
    }
  }
};
</script>

<style lang="scss">
@import "../assets/scss/ws-back-label.scss";
</style>