import { TaskState } from '@wix/bex-core'; import React, { ReactElement, ReactNode } from 'react'; import { Box, BoxProps, Loader } from '@wix/design-system'; import { observer } from 'mobx-react-lite'; export interface SplashProps extends Partial { state: TaskState; children?: ReactNode; renderError: (params: { err: unknown; isOnline: boolean }) => ReactElement; dataHook?: string; } function _Splash(props: SplashProps) { const { state, children, renderError, height = '100vh', ...rest } = props; const { status } = state; let child: ReactNode; if (status.isIdle || status.isLoading) { child = ( ); } else { child = children; } return ( {child} ); } export const Splash = observer(_Splash);