Files
shop-server/client/src/shared/ui/OrderMessageBody.tsx
T
@kirill.komarov 5ddde15fd3 base commit
2026-05-10 14:28:35 +05:00

27 lines
821 B
TypeScript

import Box from '@mui/material/Box'
import { RichTextMessageContent } from '@/shared/ui/RichTextMessageContent'
type Props = {
text: string
attachmentUrl?: string | null
imageAlt?: string
}
/** Текст чата заказа (TipTap HTML) и опциональное изображение (например чек). */
export function OrderMessageBody(props: Props) {
const { text, attachmentUrl, imageAlt = 'Вложение к сообщению' } = props
return (
<>
<RichTextMessageContent value={text} tone="chat" />
{attachmentUrl ? (
<Box
component="img"
src={attachmentUrl}
alt={imageAlt}
sx={{ mt: 1, maxWidth: '100%', borderRadius: 1, display: 'block', border: 1, borderColor: 'divider' }}
/>
) : null}
</>
)
}