Configuration options
Persistence state and controls
This hook provides automatic saving of Q&A sessions to file storage. It uses the Hiyve client's file upload/modify APIs to persist data to S3.
Features:
function QAWithPersistence() {
const [questions, setQuestions] = useState<Question[]>([]);
const { client, room } = useRoom();
const { localUserId } = useParticipants();
const {
fileId,
isSaving,
hasUnsavedChanges,
save,
markUnsaved,
} = useQAPersistence({
client,
enabled: true,
userId: localUserId,
roomName: room?.name,
onSave: (id) => console.log('Saved to:', id),
});
// Mark unsaved when questions change
useEffect(() => {
markUnsaved();
}, [questions, markUnsaved]);
return <QAPanel onQuestionsChange={setQuestions} />;
}
Hook for Q&A session persistence with auto-save.