<script lang="ts">
    import LoaderCircleIcon from "~icons/lucide/loader-circle";
    import Icon from "./icon.svelte";

    let {
        loading,
        loadingText,
        text,
    }: { loading: boolean; loadingText: string; text: string } = $props();
</script>

{#if loading}
    <Icon icon={LoaderCircleIcon} cls="h-5 w-auto animate-spin" />
    {loadingText}
{:else}
    {text}
{/if}
