import React, { ReactNode, useEffect } from 'react'; import { Box, Dialog, Text, config } from 'folds'; import { AsyncStatus, useAsyncCallback } from '../hooks/useAsyncCallback'; import { checkIndexedDBSupport } from '../utils/featureCheck'; import { SplashScreen } from '../components/splash-screen'; export function FeatureCheck({ children }: { children: ReactNode }) { const [idbSupportState, checkIDBSupport] = useAsyncCallback(checkIndexedDBSupport); useEffect(() => { checkIDBSupport(); }, [checkIDBSupport]); if (idbSupportState.status === AsyncStatus.Success && idbSupportState.data === false) { return ( Missing Browser Feature No IndexedDB support found. This application requires IndexedDB to store session data locally. Please make sure your browser support IndexedDB and have it enabled. What is IndexedDB? ); } return children; }