2024-04-22 09:38:51 +02:00
|
|
|
<template>
|
2024-04-27 06:50:30 +02:00
|
|
|
<button v-bind="$props" type="button" :disabled="loading"
|
|
|
|
|
:class="['rounded-md duration-200 relative hover:shadow disabled:opacity-70 content-none disabled:cursor-not-allowed px-3 py-2 text-sm font-semibold text-white shadow-sm', loading && '[&>*]:invisible']">
|
|
|
|
|
<div v-if="loading" class="absolute top-1/2 left-1/2 -translate-x-1/2 -translate-y-1/2 !visible">
|
2024-05-12 11:04:00 +02:00
|
|
|
<iconify-icon icon="tabler:loader-2" height="1.25rem" width="1.25rem" class="animate-spin" />
|
2024-04-27 06:50:30 +02:00
|
|
|
</div>
|
2024-04-22 09:38:51 +02:00
|
|
|
<slot />
|
|
|
|
|
</button>
|
|
|
|
|
</template>
|
|
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
|
|
|
|
import type { ButtonHTMLAttributes } from "vue";
|
|
|
|
|
|
2024-05-12 11:23:38 +02:00
|
|
|
interface Props extends /* @vue-ignore */ ButtonHTMLAttributes {}
|
2024-04-22 09:38:51 +02:00
|
|
|
|
2024-04-27 06:50:30 +02:00
|
|
|
defineProps<
|
|
|
|
|
Props & {
|
|
|
|
|
loading?: boolean;
|
|
|
|
|
}
|
|
|
|
|
>();
|
2024-04-22 09:38:51 +02:00
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
<style></style>
|