<script lang="ts">
    import { goto } from "$app/navigation";
    import ws, { SocketConnectionType } from "$lib/websocket.svelte";

    let { children } = $props();

    $effect(() => {
        console.log("ConnectionType:", ws.connectionType);
        if (ws.connectionType === SocketConnectionType.NONE) {
            goto("/");
        }
    });
</script>

{@render children?.()}
