2025-01-08 16:36:34 +01:00
|
|
|
<script lang="ts">
|
|
|
|
|
import { Utils } from "../../Utils"
|
|
|
|
|
import Loading from "./Loading.svelte"
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Some components are slow to load
|
|
|
|
|
* This item draws a 'loading' and will only start loading after a few milliseconds
|
|
|
|
|
*/
|
|
|
|
|
export let timeout = 200
|
|
|
|
|
let timeoutReached = false
|
|
|
|
|
Utils.waitFor(timeout).then(() => {
|
|
|
|
|
timeoutReached = true
|
|
|
|
|
})
|
|
|
|
|
</script>
|
|
|
|
|
|
|
|
|
|
{#if timeoutReached}
|
|
|
|
|
<slot />
|
2025-01-18 00:30:06 +01:00
|
|
|
{:else}
|
|
|
|
|
<Loading cls="h-full w-full flex justify-center items-center low-interaction" />
|
2025-01-08 16:36:34 +01:00
|
|
|
{/if}
|