1 import React, { Fragment } from 'react'; 2 import { useSelector } from 'react-redux'; 3 4 import { IReduxState } from '../../../../app/types'; 5 6 7 const BottomSheetContainer: () => JSX.Element | null = (): JSX.Element | null => { 8 const { sheet, sheetProps } = useSelector((state: IReduxState) => state['features/base/dialog']); 9 const { reducedUI } = useSelector((state: IReduxState) => state['features/base/responsive-ui']); 10 11 if (!sheet || reducedUI) { 12 return null; 13 } 14 15 return ( 16 <Fragment> 17 { React.createElement(sheet, sheetProps) } 18 </Fragment> 19 ); 20 }; 21 22 export default BottomSheetContainer;