import { Flex, Text } from "@mantine/core"; import { DialogAttachmentProps } from "./DialogAttachment"; import { useRosettaColors } from "@/app/hooks/useRosettaColors"; import { IconX } from "@tabler/icons-react"; import { useReplyMessages } from "@/app/providers/DialogProvider/useReplyMessages"; import { dotMessageIfNeeded } from "@/app/utils/utils"; import { TextParser } from "../TextParser/TextParser"; export function AttachMessages(props : DialogAttachmentProps) { const colors = useRosettaColors(); const {deselectAllMessages} = useReplyMessages(); const onClickCancel = () => { deselectAllMessages(); props.onRemove && props.onRemove(props.attach); } const jsonMessages = JSON.parse(props.attach.blob); return ( Reply messages {jsonMessages.length > 1 && <> Reply to {jsonMessages.length} messages } {jsonMessages.length == 1 && <> {jsonMessages[0].message.trim().length > 0 ? : 'Attachment'} } ) }