import { useState } from 'react' import { X } from 'lucide-react' import { useTranslation } from '../../i18n' export function CollabChatAttachment({ attachment }: { attachment: { url: string; original_name?: string; mime_type?: string } }) { const { t } = useTranslation() const [open, setOpen] = useState(false) const alt = attachment.original_name || t('collab.chat.attachedImage') return <> {alt} setOpen(true)} style={{ display: 'block', width: 180, maxWidth: '100%', maxHeight: 220, objectFit: 'cover', borderRadius: 10, cursor: 'zoom-in', marginTop: 4 }} /> {open &&
setOpen(false)} style={{ position: 'fixed', inset: 0, zIndex: 1000, background: 'rgba(0,0,0,.82)', display: 'flex', alignItems: 'center', justifyContent: 'center', padding: 24 }}>{alt} e.stopPropagation()} style={{ maxWidth: '95vw', maxHeight: '90vh', objectFit: 'contain' }} />
} }