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

<script setup>
const props = defineProps({
  disabled: {
    type: Boolean,
    default: false,
  },
  click: {
    type: Function,
    default: () => null,
  },
});

const emit = defineEmits(["click"]);

const clickAction = () => {
  if (props.disabled) {
    return;
  }
  emit("click");
  props.click && props.click();
};
</script>
