<template>
  <v-btn
    v-if="paginatedCollection.currentPage > 1 && !isLoading"
    class="mt-10"
    color="lightNeutral"
    :disabled="paginatedCollection.currentPage == 1"
    rounded
    elevation="8"
    @click="onclick()"
    v-bind="$attrs"
  >
    <v-icon>mdi-arrow-right</v-icon>
    {{ $t('previous') }}
  </v-btn>
</template>

<script>
import { mapState } from "pinia";
import { useGlobalStore } from "@/store/GlobalStore";
import BasePaginatedCollection from "@/core/classes/base/BasePaginatedCollection";

export default {
  props: {
    paginatedCollection: BasePaginatedCollection,
    onclick: Function,
  },
  computed: {
    ...mapState(useGlobalStore, ["isLoading"]),
  },
};
</script>

<style></style>
