{formatDesktopIpcPocError(props.error)}
; +} + +function DesktopIpcPocDefectAlert(props: { readonly defect: unknown }): ReactElement { + returnUnexpected defect: {formatDefect(props.defect)}
; +} + +function AsyncResultView(props: { + readonly result: AsyncResult.AsyncResult; + readonly renderSuccess: (value: A) => ReactNode; + readonly renderError: (error: E) => ReactNode; + readonly emptyLabel: string; + readonly waitingLabel: string; +}): ReactElement { + return ( + <> + {AsyncResult.matchWithError(props.result, { + onInitial: (initial) =>{initial.waiting ? props.waitingLabel : props.emptyLabel}
, + onError: (error) => props.renderError(error), + onDefect: (defect) =>Refreshing
+ ) : null} + > + ); +} + +function DesktopIpcPocClientStatus(): ReactElement { + const runtimeResult = useAtomValue(DesktopIpcPocRpcClient.runtime); + + return AsyncResult.matchWithError(runtimeResult, { + onInitial: (initial) => ( + + {initial.waiting ? "Connecting RPC client" : "RPC client idle"} + + ), + onError: () => RPC client failed, + onDefect: (defect) => {formatDefect(defect)}, + onSuccess: () => Effect RPC client ready, + }); +} + +function RuntimeInfoView(props: { readonly runtimeInfo: DesktopIpcPocRuntimeInfo }): ReactElement { + return ( ++ Echoed "{props.echo.text}" at {props.echo.echoedAt} +
+ ); +} + +function TickList(props: { readonly ticks: ReadonlyArray+ {pullResult.done ? "Stream completed" : `${pullResult.items.length} ticks received`} +
+ )} + /> +