Hiyve Components - v1.0.0
    Preparing search index...

    Interface ChatState

    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>
    );
    }

    ChatMessage for message data structure

    interface ChatState {
        messages: ChatMessage[];
        unreadCount: number;
    }
    Index

    Properties

    messages: ChatMessage[]

    Array of chat messages, ordered chronologically

    unreadCount: number

    Number of unread messages