import * as React from 'react' import { Flex, ThemeProvider, ToastProvider, studioTheme, Portal, Box, PortalProvider, } from '@sanity/ui' import { AssetFromSource, AssetSourceComponentProps } from '@sanity/types' import { useSelector } from '@xstate/react' import { DialogSettings } from './components/Dialogs/DialogSettings' import { GridImageBrowser } from './components/Grids/GridImageBrowser' import { AssetBrowserDispatchProvider } from './contexts/AssetSourceDispatchContext' import { GlobalStateProvider, useGlobalState, } from './contexts/GlobalStateContext' interface AppProps extends Omit { onSelect: (assetFromSource: AssetFromSource[]) => void } const App = React.forwardRef(({ onClose }, ref) => { const globalState = useGlobalState() const showSettings = useSelector(globalState, (state) => state.matches('showingSettings') ) const handleStopPropagation = (e: React.MouseEvent) => { e.nativeEvent.stopImmediatePropagation() e.stopPropagation() } return ( <> {onClose ? ( ) : ( )} {showSettings ? : null} ) }) export const InstagramApp = React.forwardRef( (props, ref) => ( ) )