UNPKG

@cometchat/chat-uikit-react-native

Version:

Ready-to-use Chat UI Components for React Native

78 lines (77 loc) 2.7 kB
import { JSX } from "react"; import { CometChatMentionsFormatter, CometChatMessageTemplate, CometChatTextFormatter, CometChatUrlsFormatter, MessageBubbleAlignmentType } from "../shared"; import { CometChat } from "@cometchat/chat-sdk-react-native"; import { CometChatTheme } from "../theme/type"; import { DeepPartial } from "../shared/helper/types"; /** * Interface for the props of CometChatThreadHeader component. * * @interface CometChatThreadHeaderInterface */ export interface CometChatThreadHeaderInterface { /** * The parent message for the thread. It is a CometChat BaseMessage object. * * @type {CometChat.BaseMessage} */ parentMessage: CometChat.BaseMessage; /** * Optional custom message template to render the message. * * @type {CometChatMessageTemplate} */ template?: CometChatMessageTemplate; /** * Custom styles for the thread header, partially overriding the default theme. * * @type {DeepPartial<CometChatTheme["threadHeaderStyles"]>} */ style?: DeepPartial<CometChatTheme["threadHeaderStyles"]>; /** * toggle visibility for the reply count. * * @type {boolean} */ replyCountVisibility?: boolean; /** * toggle visibility for the reply count bar. * * @type {boolean} */ replyCountBarVisibility?: boolean; /** * Custom styles for the thread header, partially overriding the default theme. */ receiptsVisibility?: boolean; /** * toggle visibility for the receipts. * * @type {boolean} */ avatarVisibility?: boolean; /** * Alignment type for the parent message bubble */ alignment?: MessageBubbleAlignmentType; /** * Function that returns a custom string representation for a parent message's sent date. * * @param message - The base message object. * @returns A string representing the custom date. */ datePattern?: (message: CometChat.BaseMessage) => string; /** * Collection of text formatter classes to apply custom formatting. * * @type {Array<CometChatMentionsFormatter | CometChatUrlsFormatter | CometChatTextFormatter>} */ textFormatters?: Array<CometChatMentionsFormatter | CometChatUrlsFormatter | CometChatTextFormatter>; } /** * CometChatThreadHeader component renders the header of a message thread including * the message bubble and the reply count. * * @param {CometChatThreadHeaderInterface} props - The properties for the component. * @returns {JSX.Element} The rendered thread header. */ export declare const CometChatThreadHeader: (props: CometChatThreadHeaderInterface) => JSX.Element;