import { Component, createEffect, Show } from "solid-js"; import { Header } from "./header"; import { Sidebar } from "../Sidebar"; import { activeURI, clanList } from "../App"; import { redirect, RouteSectionProps, useNavigate } from "@solidjs/router"; import { Toaster } from "solid-toast"; export const Layout: Component = (props) => { const navigate = useNavigate(); createEffect(() => { console.log("Layout props", props.location); console.log( "empty ClanList, redirect to welcome page", clanList().length === 0, ); if (clanList().length === 0) { navigate("/welcome"); } }); return (
{props.children}
); };