trifid/tfweb/src/components/LoadingWrapper.svelte

29 lines
541 B
Svelte
Raw Normal View History

2023-05-31 01:51:57 +00:00
<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}