<script lang="ts">
  import type { Snippet } from 'svelte';

  let {
    type = undefined,
    percent = undefined,
    card = true,
    children
  }: {
    type?: string | undefined;
    percent?: number | undefined;
    card?: boolean;
    children?: Snippet;
  } = $props();
</script>

<div class:card>
  {#if type}
    Loading {type} ...{percent ? ` ${percent}%` : ''}
  {:else}
    {@render children?.()}
  {/if}
</div>
