<script lang="ts">
	import { onMount, type Snippet } from 'svelte';
	import { userStore } from './UserStore.svelte';

	let ready = $state(false);

	const { children }: { children: Snippet } = $props();

	onMount(() => {
		ready = userStore.checkLogin();
	});
</script>

{#if ready}
	{@render children()}
{/if}
