<template>
  <section class="mt-4">
    <h2 class="text-lg font-semibold mb-2">Usage Limits</h2>
    <div class="mb-2">
      <span v-if="loadingLimits" class="text-slate-700"
        >Checking... <span class="animate-spin">⏳</span></span
      >
      <span v-else class="text-slate-700">{{ limitsMessage }}</span>
    </div>
    <button
      class="w-full text-md bg-gradient-to-b from-blue-400 to-blue-700 shadow-[inset_0_-1px_0_0_rgba(0,0,0,0.5)] text-white px-4 py-2 rounded-md"
      @click="recheckLimits"
    >
      Recheck Limits
    </button>
  </section>
</template>

<script lang="ts">
import { Component, Vue, Prop, Emit } from "vue-facing-decorator";

@Component({ name: "UsageLimitsSection" })
export default class UsageLimitsSection extends Vue {
  @Prop({ required: true }) loadingLimits!: boolean;
  @Prop({ required: true }) limitsMessage!: string;

  @Emit("recheck-limits")
  recheckLimits() {}
}
</script>
