|
|
@@ -1,6 +1,6 @@
|
|
|
import React, { useState } from 'react';
|
|
|
import { useClassroomContext } from './ClassroomProvider';
|
|
|
-import { UserGroupIcon, XMarkIcon } from '@heroicons/react/24/outline';
|
|
|
+import { UserGroupIcon, XMarkIcon, EyeIcon, UsersIcon } from '@heroicons/react/24/outline';
|
|
|
import { Button } from '@/client/components/ui/button';
|
|
|
import { Card, CardContent, CardHeader, CardTitle } from '@/client/components/ui/card';
|
|
|
import {
|
|
|
@@ -17,7 +17,7 @@ import { IMToggleMuteButton } from './IMToggleMuteButton';
|
|
|
import { RTCToggleMuteButton } from './RTCToggleMuteButton';
|
|
|
|
|
|
export const TeacherStudentManagementButton: React.FC = () => {
|
|
|
- const { students, kickStudent } = useClassroomContext();
|
|
|
+ const { students, kickStudent, onlineCount, pvCount } = useClassroomContext();
|
|
|
const [showPanel, setShowPanel] = useState(false);
|
|
|
const [confirmDialog, setConfirmDialog] = useState<{
|
|
|
open: boolean;
|
|
|
@@ -102,30 +102,44 @@ export const TeacherStudentManagementButton: React.FC = () => {
|
|
|
<XMarkIcon className="w-4 h-4" />
|
|
|
</Button>
|
|
|
</CardHeader>
|
|
|
- <CardContent className="p-3 max-h-60 overflow-y-auto">
|
|
|
- {students.length === 0 ? (
|
|
|
- <p className="text-gray-500 text-sm">暂无学生加入</p>
|
|
|
- ) : (
|
|
|
- <div className="space-y-2">
|
|
|
- {students.map((student) => (
|
|
|
- <div key={student.id} className="flex items-center justify-between p-2 border rounded text-sm">
|
|
|
- <span>{student.name}</span>
|
|
|
- <div className="flex gap-1 flex-wrap">
|
|
|
- <RTCToggleMuteButton userId={student.id} userName={student.name} />
|
|
|
- <IMToggleMuteButton userId={student.id} userName={student.name} />
|
|
|
- <Button
|
|
|
- onClick={() => openConfirmDialog('kick', student.id, student.name)}
|
|
|
- variant="outline"
|
|
|
- size="sm"
|
|
|
- className="text-xs bg-red-100 text-red-700 hover:bg-red-200 border-red-300"
|
|
|
- >
|
|
|
- 移出
|
|
|
- </Button>
|
|
|
- </div>
|
|
|
- </div>
|
|
|
- ))}
|
|
|
+ <CardContent className="p-3">
|
|
|
+ {/* 统计信息 */}
|
|
|
+ <div className="flex justify-between mb-3 p-2 bg-gray-50 rounded text-sm">
|
|
|
+ <div className="flex items-center">
|
|
|
+ <UsersIcon className="w-4 h-4 mr-1 text-blue-500" />
|
|
|
+ <span>在线: {onlineCount}人</span>
|
|
|
+ </div>
|
|
|
+ <div className="flex items-center">
|
|
|
+ <EyeIcon className="w-4 h-4 mr-1 text-green-500" />
|
|
|
+ <span>看过: {pvCount}人</span>
|
|
|
</div>
|
|
|
- )}
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <div className="max-h-60 overflow-y-auto">
|
|
|
+ {students.length === 0 ? (
|
|
|
+ <p className="text-gray-500 text-sm">暂无学生加入</p>
|
|
|
+ ) : (
|
|
|
+ <div className="space-y-2">
|
|
|
+ {students.map((student) => (
|
|
|
+ <div key={student.id} className="flex items-center justify-between p-2 border rounded text-sm">
|
|
|
+ <span>{student.name}</span>
|
|
|
+ <div className="flex gap-1 flex-wrap">
|
|
|
+ <RTCToggleMuteButton userId={student.id} userName={student.name} />
|
|
|
+ <IMToggleMuteButton userId={student.id} userName={student.name} />
|
|
|
+ <Button
|
|
|
+ onClick={() => openConfirmDialog('kick', student.id, student.name)}
|
|
|
+ variant="outline"
|
|
|
+ size="sm"
|
|
|
+ className="text-xs bg-red-100 text-red-700 hover:bg-red-200 border-red-300"
|
|
|
+ >
|
|
|
+ 移出
|
|
|
+ </Button>
|
|
|
+ </div>
|
|
|
+ </div>
|
|
|
+ ))}
|
|
|
+ </div>
|
|
|
+ )}
|
|
|
+ </div>
|
|
|
</CardContent>
|
|
|
</Card>
|
|
|
</div>
|