29 lines
541 B
Svelte
29 lines
541 B
Svelte
|
<script lang="ts">
|
||
|
import {Logger, logSetup} from "$lib/logger";
|
||
|
|
||
|
export let isLoading;
|
||
|
export let isError;
|
||
|
export let error;
|
||
|
|
||
|
logSetup();
|
||
|
let logger = new Logger("LoadingWrapper.svelte");
|
||
|
|
||
|
function loadingproclog() {
|
||
|
if (!isLoading) {
|
||
|
logger.info("page loaded - content paint");
|
||
|
}
|
||
|
}
|
||
|
|
||
|
$: isLoading, loadingproclog();
|
||
|
</script>
|
||
|
|
||
|
{#if isLoading}
|
||
|
<h1>its loading</h1>
|
||
|
{:else}
|
||
|
{#if isError}
|
||
|
<h1>error: {error}</h1>
|
||
|
{:else}
|
||
|
<slot></slot>
|
||
|
{/if}
|
||
|
{/if}
|