This hook combines useQAListener with higher-level state management
for badge notifications and session activity tracking. It handles:
clearNewQuestionBadge callback for tab switchingimport { 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
}
Manages Q&A session state for container-level components.