import * as React from 'react'; import { SxProps, Theme } from '@mui/system'; import { type ChatMessageStatus, type ChatRole, type ChatMessage as ChatMessageEntity, type MessageRootProps, type MessageGroupSlotProps } from '@mui/x-chat-headless'; import { type ChatMessageClasses } from "./chatMessageClasses.mjs"; import { type ChatMessageErrorProps } from "../ChatMessageError/ChatMessageError.mjs"; import { type ChatMessageAvatarProps } from "./ChatMessageAvatar.mjs"; import { type ChatMessageContentProps } from "./ChatMessageContent.mjs"; import { type ChatMessageMetaProps } from "./ChatMessageMeta.mjs"; import { type ChatMessageInlineMetaProps } from "./ChatMessageInlineMeta.mjs"; import { type ChatMessageActionsProps } from "./ChatMessageActions.mjs"; import { type ChatStreamingIndicatorProps } from "../ChatIndicators/ChatStreamingIndicator.mjs"; export interface ChatMessageSlots { /** The styled root element. */ root: React.ElementType; /** * The avatar component. Pass `null` to hide it and collapse the avatar grid track. * Function form receives the message context and may return `null` for per-message hiding, * but the grid track is only dropped when the slot itself is `null`. */ avatar: React.ElementType | null; /** The bubble component that renders message content. */ content: React.ElementType; /** * The external meta component (compact variant). Pass `null` to hide it. */ meta: React.ElementType | null; /** * The inline meta component (default variant; rendered inside the bubble). Pass `null` to hide it. */ inlineMeta: React.ElementType | null; /** * The error component rendered under the bubble when status === 'error'. * Pass `null` to hide the error surface entirely (no component is mounted). */ error: React.ElementType | null; /** * The actions component, rendered under the bubble. * Receives `{ messageId }` as props. * Pass `null` to hide actions entirely; omit to render only `extraActions` * (from `slotProps.actions`) if provided. */ actions: React.ElementType | null; /** * The author-name label. Rendered by the surrounding `ChatMessageGroup` * (default variant: above the bubble; compact variant: inside the message * grid). Forwarded through `slots.message.authorName` from `ChatBox`. Pass * `null` to hide. */ authorName: React.ElementType | null; /** * The animated streaming indicator, rendered inside the bubble (after the * streamed parts) while this assistant message has `status: 'streaming'`. * Pass `null` to hide it. */ streamingIndicator: React.ElementType | null; } /** * Message context passed to a function-valued `slotProps.actions` (and the flat * `slotProps.messageActions`), so a consumer can return per-message action props * — most commonly `extraActions` for assistant rows. */ export interface ChatMessageActionsResolveContext { message: ChatMessageEntity | null; messageId: string; role?: ChatRole; status?: ChatMessageStatus; streaming: boolean; } export interface ChatMessageSlotProps { root?: any; avatar?: Partial; content?: Partial; meta?: Partial; inlineMeta?: Partial; error?: Partial; actions?: Partial | ((context: ChatMessageActionsResolveContext) => Partial); authorName?: MessageGroupSlotProps['authorName']; streamingIndicator?: Partial; } export interface ChatMessageProps extends Omit { className?: string; sx?: SxProps; classes?: Partial; slots?: Partial; slotProps?: ChatMessageSlotProps; /** * @ignore * Internal: the group's author label, injected by the headless `MessageGroup` * in compact mode so it can share the message's CSS grid. Not part of a * consumer's custom composition (which uses `children`). */ groupAuthorName?: React.ReactNode; } declare const ChatMessage: React.ForwardRefExoticComponent>; export { ChatMessage };