import { Tooltip, TooltipContent, TooltipTrigger } from '@renderer/components/ui/tooltip'; import { Info } from 'lucide-react'; import { AttachmentDisplay } from './AttachmentDisplay'; import type { AttachmentMeta, SourceMessageSnapshot } from '@shared/types'; interface SourceMessageAttachmentsProps { teamName: string; sourceMessageId: string; sourceMessage: SourceMessageSnapshot; } export const SourceMessageAttachments = ({ teamName, sourceMessageId, sourceMessage, }: SourceMessageAttachmentsProps): React.JSX.Element | null => { if (!sourceMessage.attachments?.length) return null; const attachments: AttachmentMeta[] = sourceMessage.attachments.map((a) => ({ id: a.id, filename: a.filename, mimeType: a.mimeType, size: a.size, ...(a.filePath ? { filePath: a.filePath } : {}), })); const truncatedText = sourceMessage.text.length > 300 ? sourceMessage.text.slice(0, 297) + '...' : sourceMessage.text; const formattedDate = (() => { try { return new Date(sourceMessage.timestamp).toLocaleString(); } catch { return sourceMessage.timestamp; } })(); return (
From original message

{sourceMessage.from} · {formattedDate}

{truncatedText}

); };