// @flow import React from 'react'; import Drawer from '@mui/material/Drawer'; import CommentSelectors from 'component/commentCreate/comment-selectors'; type TextareaWrapperProps = { slimInput?: boolean, slimInputButtonRef?: any, children: any, isDrawerOpen: boolean, showSelectors?: boolean, commentSelectorsProps?: any, tipModalOpen?: boolean, onSlimInputClose?: () => void, toggleDrawer: () => void, closeSelector?: () => void, }; export const TextareaWrapper = (wrapperProps: TextareaWrapperProps) => { const { children, slimInput, slimInputButtonRef, isDrawerOpen, commentSelectorsProps, showSelectors, tipModalOpen, onSlimInputClose, toggleDrawer, closeSelector, } = wrapperProps; function handleCloseAll() { toggleDrawer(); if (closeSelector) closeSelector(); if (onSlimInputClose) onSlimInputClose(); } return slimInput ? ( !isDrawerOpen ? (
{children}
) : ( {children} {showSelectors && } ) ) : ( children ); };