<template>
  <button
    :disabled="isDisabled"
    :aria-disabled="isDisabled"
    class="btn btn-primary d-flex align-items-center"
    @click='displayComponent'
    >
    {{ this.buttonText }}
    <loader
    class="ms-2"
    v-if="display"
    v-bind:style="{width: `${sizeInRem}rem`, height: `${sizeInRem}rem`}"
    v-bind:class="[this.loaderColor, this.loaderPosition]"
    />
  </button>
</template>

<script>
import loader from "@/ux-components/loader/loader";
export default {
  name: "buttonPrimary",
  props: {
    buttonText: String,
    isDisabled: Boolean,
    loaderColor: String,
    loaderPosition: String,
    sizeInRem: Number
  },
  data() {
    return {
      display: false,
    };
  },
  methods: {
    displayComponent() {
      this.display = true;
    },
  },
  components: {
    loader,
  },
};
</script>
