'use client' import { cn } from '@langgenius/dify-ui/cn' import { Drawer, DrawerBackdrop, DrawerCloseButton, DrawerContent, DrawerPopup, DrawerPortal, DrawerTitle, DrawerViewport, } from '@langgenius/dify-ui/drawer' import { useTranslation } from 'react-i18next' type IFloatRightContainerProps = { isMobile: boolean isOpen: boolean onClose: () => void children?: React.ReactNode showClose?: boolean panelClassName?: string title?: string mask?: boolean } const FloatRightContainer = ({ isMobile, children, isOpen, onClose, showClose = false, panelClassName, title, mask = true, }: IFloatRightContainerProps) => { const { t } = useTranslation() return ( <> {isMobile && ( { if (!open) onClose() }} > {(title || showClose) && (
{title && ( {title} )} {showClose && ( $['operation.close'], { ns: 'common' })} className="size-6 rounded-md" /> )}
)} {children}
)} {!isMobile && isOpen && <>{children}} ) } export default FloatRightContainer