<template>
  <b-field class="pb-5 pt-6">
    <b-button
      type="is-info is-light"
      icon-left="arrow-left-box"
      @click="regresar()"
    >
      Regresar
    </b-button>
  </b-field>
</template>

<script>
export default {
  props: {
    path: {
      type: String,
      required: true,
    },
    deleteFromLocalStorage: {
      type: Array,
      default: () => [],
    },
  },
  methods: {
    regresar() {
      for (let i = 0; i < this.deleteFromLocalStorage.length; i++)
        localStorage.removeItem(this.deleteFromLocalStorage[i])
      this.$router.push(this.path)
    },
  },
}
</script>
