import React, { useState, useRef } from 'react'; import { Box, Fab, Slide, useMediaQuery, useTheme } from '@mui/material'; import ChatIcon from '@mui/icons-material/Chat'; import CloseIcon from '@mui/icons-material/Close'; import ChatInterface from './ChatInterface'; type FloatingChatProps = { onClose: () => void; }; const FloatingChat: React.FC = ({ onClose }) => { const [isOpen, setIsOpen] = useState(true); const handleClose = () => { setIsOpen(false); onClose(); }; const theme = useTheme(); const isMobile = useMediaQuery(theme.breakpoints.down('sm')); const chatRef = useRef(null); const toggleChat = () => setIsOpen(prev => !prev); const ANIM_DURATION = 300; const FAB_SIZE = 60; const FAB_GAP = isMobile ? 16 : 24; return ( {/* Slide wrapper: NOTE -> overflow must be visible so internal header isn't clipped */} {/* FAB wrapper (keeps FAB mounted during transition) */} {isOpen ? : } ); }; export default FloatingChat;