base commit
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
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}
|
||||
</>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user