import React, { useState } from 'react'; import { useClassroomContext } from './ClassroomProvider.tsx'; import { ClassStatus } from './useClassroom.ts'; export const StudentView = () => { const { handUp, sendQuestion, classStatus, isJoinedClass } = useClassroomContext(); const [questionText, setQuestionText] = useState(''); const handleSendQuestion = () => { if (questionText.trim()) { sendQuestion(questionText); setQuestionText(''); } }; return (
{isJoinedClass && (

互动功能

setQuestionText(e.target.value)} onKeyPress={(e) => e.key === 'Enter' && handleSendQuestion()} />
)}
); };