Hiyve Components - v1.0.0
    Preparing search index...
    • Manages Q&A session state for container-level components.

      Parameters

      Returns UseQASessionStateResult

      This hook combines useQAListener with higher-level state management for badge notifications and session activity tracking. It handles:

      • Tracking all questions even when the Q&A tab is not active
      • Showing a "new question" badge when the user is on a different tab
      • Detecting when a Q&A session becomes active
      • Providing a clearNewQuestionBadge callback for tab switching
      import { useQASessionState } from '@hiyve/react-collaboration';

      function Sidebar({ activeTab }) {
      const { isOwner } = useRoom();
      const { localUserId } = useParticipants();

      const {
      questions,
      hasNewQuestion,
      hasActiveQASession,
      clearNewQuestionBadge,
      } = useQASessionState({
      isOwner,
      localUserId: localUserId || '',
      activeTabId: activeTab,
      });

      // Use hasNewQuestion for tab badge
      // Use hasActiveQASession to show QASession active state
      // Call clearNewQuestionBadge when switching to the Q&A tab
      }