<script lang="ts">
  import { Alert, Spinner } from "flowbite-svelte";

  export let loading: boolean;
  export let error: string | undefined;
</script>

{#if loading}
  <div class="h-full flex justify-center items-center">
    <Spinner size={"16"} />
  </div>
{:else if error}
  <Alert color="red">
    <span class="font-medium">Error occured!</span>
    {error}
  </Alert>
{:else}
  <slot />
{/if}
