import { Splash } from '@vegaprotocol/ui-toolkit'; import { ReactNode } from 'react'; interface AsyncRendererProps { loading: boolean; error: Error | undefined; data: T; children: (data: T) => ReactNode; } // eslint-disable-next-line export function AsyncRenderer({ loading, error, data, children, }: AsyncRendererProps) { if (error) { return Something went wrong: {error.message}; } if (loading) { return Loading...; } return <>{children(data)}; }