atmosphere explorer pds.ls
tool typescript atproto
at main 20 lines 468 B view raw
1import { JSX, Show, Suspense } from "solid-js"; 2import { Spinner } from "./spinner.jsx"; 3 4export const NestedLayout = (props: { 5 key: string | undefined; 6 hasChild: boolean; 7 view: () => JSX.Element; 8 children: JSX.Element; 9}) => ( 10 <Show keyed when={props.key}> 11 {(_) => ( 12 <> 13 <Show when={props.hasChild}> 14 <Suspense fallback={<Spinner />}>{props.children}</Suspense> 15 </Show> 16 {props.view()} 17 </> 18 )} 19 </Show> 20);