Hiyve Components - v1.0.0
    Preparing search index...
    • QuestionItem displays a single question with voting, actions, and answers.

      Parameters

      Returns ReactElement

      This component shows:

      • Author avatar, name, and timestamp
      • Question content with "Open" badge when open for community answers
      • Vote count and vote button
      • Action buttons (answer, delete, pin, open/close for answers) for owners
      • Answer button for all participants when question is open for answers
      • Answer section with multiple answers support

      Visual States:

      • Normal question: Standard background
      • Answered question: Subtle green background
      • Pinned question: Orange left border
      • Open for answers: Purple "Open" badge in header

      Answer Permissions:

      • Owner can always answer any question
      • Participants can answer when question.isOpenForAnswers is true
      <QuestionItem
      question={question}
      isOwner={isOwner}
      localUserId={userId}
      isAnswering={answeringId === question.id}
      onToggleVote={() => toggleVote(question.id)}
      onAnswer={(content) => answerQuestion(question.id, content)}
      onToggleAnswering={() => setAnsweringId(question.id)}
      onDelete={() => deleteQuestion(question.id)}
      onTogglePin={() => pinQuestion(question.id, !question.isPinned)}
      labels={labels}
      icons={icons}
      colors={colors}
      styles={styles}
      />