import { Link } from "react-router-dom"; import { Suspense } from "react"; import { graphql, useLazyLoadQuery } from "react-relay"; import { Logo } from "./Logo.tsx"; import { Avatar } from "./Avatar.tsx"; import { Button } from "./Button.tsx"; import { logout, useSessionContext } from "../lib/useSession.ts"; import type { LayoutQuery } from "../__generated__/LayoutQuery.graphql.ts"; interface LayoutProps { children: React.ReactNode; headerChart?: React.ReactNode; subNav?: React.ReactNode; } function UserProfile({ handle }: { handle: string }) { const data = useLazyLoadQuery( graphql` query LayoutQuery($where: NetworkSlicesActorProfileWhereInput) { networkSlicesActorProfiles(first: 1, where: $where) { edges { node { actorHandle avatar { url(preset: "avatar") } } } } } `, { where: { actorHandle: { eq: handle }, }, }, ); const profile = data.networkSlicesActorProfiles.edges[0]?.node; return ( <> @{handle} Docs ); } export default function Layout({ children, headerChart, subNav, }: LayoutProps) { const { session } = useSessionContext(); const isAuthenticated = session?.authenticated; const userInfo = session?.user; return (
{headerChart && (
{headerChart}
)}

Slices

network.slices

{isAuthenticated && userInfo ? ( @{userInfo.handle || userInfo.did} } > ) : ( <> Join Waitlist Sign In )}
{subNav &&
{subNav}
}
{children}
); }