import { useState, useRef, useEffect } from 'react'; import Info from '../assets/info.svg'; import PageIcon from '../assets/documentation.svg'; import EmailIcon from '../assets/envelope.svg'; import { useTranslation } from 'react-i18next'; const Help = () => { const [isOpen, setIsOpen] = useState(false); const dropdownRef = useRef(null); const buttonRef = useRef(null); const { t } = useTranslation(); const toggleDropdown = () => { setIsOpen((prev) => !prev); }; const handleClickOutside = (event: MouseEvent) => { if ( dropdownRef.current && !dropdownRef.current.contains(event.target as Node) && buttonRef.current && !buttonRef.current.contains(event.target as Node) ) { setIsOpen(false); } }; useEffect(() => { document.addEventListener('mousedown', handleClickOutside); return () => { document.removeEventListener('mousedown', handleClickOutside); }; }, []); return (
{isOpen && (
Documentation {t('documentation')} Email Us {t('emailUs')}
)}
); }; export default Help;