UNPKG

softchatjs-react

Version:
51 lines (48 loc) 1.66 kB
import * as react_jsx_runtime from 'react/jsx-runtime'; import { Message, UserMeta } from 'softchatjs-core'; import { ConversationItem } from '../../providers/clientStateProvider.mjs'; import { NavButton } from '../navigation/index.mjs'; import 'react'; type ChatProps = { renderChatBubble?: (message: Message) => JSX.Element; renderConversationList?: (props: { conversations: ConversationItem[]; onCoversationItemClick: (conversationItem: ConversationItem) => void; }) => JSX.Element; renderChatHeader?: () => JSX.Element; renderChatInput?: (props: { onChange: (e: string) => void; }) => JSX.Element; renderNavbar?: (props: NavButton[]) => JSX.Element; onCreateBroadcastList?: () => void; user: UserMeta; userList?: UserMeta[]; /** * use activeConversationId to preselect a conversation once the user enters the chat. */ activeConversationId?: string; /**@note * This value calculates the the height off the container incase of an external header * Value should be in px i.e 300 */ headerHeightOffset?: number; /** * FCM token used to send push notifications to web users */ webToken?: string; /** * Hide the broadcast icon on the navigation bar * NOTE: this doesn't disable the functionality itself */ enableBroadcasts?: boolean; /** * Set a custom height for the chat container */ height?: number; /** * Set a custom width for the chat container */ width?: number; }; declare const Chat: (props: ChatProps) => react_jsx_runtime.JSX.Element; export { Chat as default };