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

    Interface ChatMessage

    Chat message in a video conference room.

    Represents a single chat message. Messages can be from participants, the local user, or system-generated (e.g., "User joined the room").

    Rendering chat messages:

    function ChatMessageItem({ message }: { message: ChatMessage }) {
    if (message.isSystem) {
    return <div className="system-message">{message.content}</div>;
    }

    return (
    <div className={message.isLocal ? 'my-message' : 'their-message'}>
    <strong>{message.userName || message.userId}</strong>
    <p>{message.content}</p>
    <time>{message.timestamp.toLocaleTimeString()}</time>
    </div>
    );
    }
    • ChatState for the chat state container
    • useChat for the hook to access chat
    interface ChatMessage {
        content: string;
        externalUserId?: string;
        id: string;
        isLocal?: boolean;
        isSystem?: boolean;
        timestamp: Date;
        userId: string;
        userName?: string;
    }
    Index

    Properties

    content: string

    Message content/text

    externalUserId?: string

    External user ID of the sender

    id: string

    Unique message identifier

    isLocal?: boolean

    Whether this message was sent by the local user

    isSystem?: boolean

    Whether this is a system-generated message

    timestamp: Date

    When the message was sent

    userId: string

    User ID of the sender (or 'system' for system messages)

    userName?: string

    Display name of the sender