<script lang="ts">
import locale from "$stores/locale";

export let type: string | undefined = undefined;
export let percent: number | undefined = undefined;
export let card = true;
</script>

<div class:card>
  {#if type}
    {$locale({
      values: { type, percent: percent ? ` ${percent}%` : '' }
    }).common?.loading ?? `Loading ${type} ...${percent ? ` ${percent}%` : ''}`}
  {:else}
    <slot />
  {/if}
</div>
