<template>
  <a class="bg-table-btn" :class="{ disabled: disabled }" @click="clickAction">
    <slot />
  </a>
</template>

<script>
export default {
  name: "BgTableBtn",
  props: {
    disabled: {
      type: Boolean,
      default: false,
    },
    click: {
      type: Function,
      default: () => null,
    },
  },
  emits: ["click"],
  methods: {
    clickAction() {
      if (this.disabled) {
        return;
      }

      this.$emit("click");

      this.click && this.click();
    },
  },
};
</script>
