2024-08-14 00:58:26 +00:00
|
|
|
<script lang="ts">
|
2024-08-16 17:50:38 +00:00
|
|
|
import {slide, fade} from "svelte/transition"
|
2024-08-14 00:58:26 +00:00
|
|
|
|
2025-02-04 00:37:14 +00:00
|
|
|
interface Props {
|
|
|
|
|
loading?: boolean
|
|
|
|
|
children?: import("svelte").Snippet
|
2026-06-24 20:10:06 +00:00
|
|
|
class?: string
|
2025-02-04 00:37:14 +00:00
|
|
|
}
|
|
|
|
|
|
2026-06-24 20:10:06 +00:00
|
|
|
const {loading = false, children, ...props}: Props = $props()
|
2024-08-14 00:58:26 +00:00
|
|
|
</script>
|
|
|
|
|
|
2026-06-24 20:10:06 +00:00
|
|
|
<span class="flex min-h-10 items-center justify-center {props.class}">
|
2024-08-14 00:58:26 +00:00
|
|
|
{#if loading}
|
2024-08-16 17:50:38 +00:00
|
|
|
<span class="pr-3" transition:slide|local={{axis: "x"}}>
|
2025-02-03 23:01:42 +00:00
|
|
|
<span class="loading loading-spinner" transition:fade|local={{duration: 100}}></span>
|
2024-08-14 00:58:26 +00:00
|
|
|
</span>
|
|
|
|
|
{/if}
|
2025-02-04 00:37:14 +00:00
|
|
|
{@render children?.()}
|
2024-08-14 00:58:26 +00:00
|
|
|
</span>
|