import { lazy, Suspense, type ComponentProps, type ComponentType } from "react"; /** Keep the surrounding workspace usable while an optional surface loads. */ export function deferred>(load: () => Promise) { const Surface = lazy(async () => ({ default: await load() })) as ComponentType>; return function Deferred(props: ComponentProps) { return Loading…

}>
; }; }