<script lang="ts">
  interface Props {
    type?: string | undefined;
    percent?: number | undefined;
    card?: boolean;
    children?: import('svelte').Snippet;
  }

  let {
    type = undefined,
    percent = undefined,
    card = true,
    children
  }: Props = $props();
</script>

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