import type { ComponentChildren } from 'preact'; import { Suspense } from 'preact/compat'; import { signedOut } from '@/api/load'; import { Card } from '@/comps/ui/card'; import { reasonText } from '@/utils/format'; /** A section that waits for `load`, under the route's loading frame; a failure stays inside it. */ export async function Settle({ load }: { load: () => Promise }) { try { return await load(); } catch (error) { return ; } } /** A section that streams in behind its loading box; `load` runs when it renders, and a failure stays inside. */ export function Stream({ fallback, load, }: { fallback: ComponentChildren; load: () => Promise; }) { return ( ); } function SectionFailure({ error }: { error: unknown }) { return (

{signedOut(error) ? ( <> Your session ended.{' '} Sign in again . ) : ( reasonText(error) )}

); }