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

    Represents a question in the Q&A session.

    Questions can be upvoted by participants and answered by the host. Owners can also open questions for community answers, allowing any participant to submit answers. Multiple answers are supported via the answers array, with owner answers automatically marked as accepted.

    Answer Modes:

    • Owner-only (default): Only the room owner can answer questions
    • Open for answers: Any participant can answer when isOpenForAnswers is true
    const question: Question = {
    id: 'q-123',
    authorId: 'user-456',
    authorName: 'John Doe',
    content: 'What time does the session end?',
    createdAt: Date.now(),
    upvotes: ['user-789', 'user-101'],
    isAnswered: false,
    isPinned: false,
    isOpenForAnswers: true, // Allows community answers
    answers: [], // Multiple answers supported
    };
    interface Question {
        answers?: Answer[];
        authorId: string;
        authorName?: string;
        content: string;
        createdAt: number;
        id: string;
        isAnswered: boolean;
        isOpenForAnswers?: boolean;
        isPinned: boolean;
        upvotes: string[];
    }
    Index

    Properties

    answers?: Answer[]

    Array of answers (supports multiple answers when open for community responses)

    authorId: string

    User ID of the person who asked

    authorName?: string

    Display name of the asker

    content: string

    Question content (plain text)

    createdAt: number

    Timestamp when the question was posted

    id: string

    Unique identifier for the question

    isAnswered: boolean

    Whether this question has been answered

    isOpenForAnswers?: boolean

    Whether this question is open for any user to answer (owner-controlled)

    isPinned: boolean

    Whether this question is pinned to the top

    upvotes: string[]

    Array of user IDs who upvoted this question