import React, { useState, useRef, useEffect } from 'react'; import { DownloadIcon, PrintIcon, MarkdownIcon, ChevronDownIcon } from './Icons'; import { translations } from '../constants'; interface ExportMenuProps { onDownloadMarkdown: () => void; onPrint: () => void; t: typeof translations.de; } export const ExportMenu: React.FC = ({ onDownloadMarkdown, onPrint, t }) => { const [isOpen, setIsOpen] = useState(false); const menuRef = useRef(null); useEffect(() => { const handleClickOutside = (event: MouseEvent) => { if (menuRef.current && !menuRef.current.contains(event.target as Node)) { setIsOpen(false); } }; document.addEventListener('mousedown', handleClickOutside); return () => { document.removeEventListener('mousedown', handleClickOutside); }; }, []); return (
{isOpen && (
)}
); };