Chat state for meeting text chat.
Contains all chat messages and an unread counter for showing notification badges.
Chat button with unread badge:
function ChatButton({ onPress }: { onPress: () => void }) { const { unreadCount } = useChat(); return ( <TouchableOpacity onPress={onPress}> <Text>Chat</Text> {unreadCount > 0 && ( <View style={styles.badge}> <Text style={styles.badgeText}>{unreadCount}</Text> </View> )} </TouchableOpacity> );} Copy
function ChatButton({ onPress }: { onPress: () => void }) { const { unreadCount } = useChat(); return ( <TouchableOpacity onPress={onPress}> <Text>Chat</Text> {unreadCount > 0 && ( <View style={styles.badge}> <Text style={styles.badgeText}>{unreadCount}</Text> </View> )} </TouchableOpacity> );}
ChatMessage for message data structure
Array of chat messages, ordered chronologically
Number of unread messages
Chat state for meeting text chat.
Remarks
Contains all chat messages and an unread counter for showing notification badges.
Example
Chat button with unread badge:
See
ChatMessage for message data structure