fix
All checks were successful
Deploy on Master Change / deploy (push) Successful in 1m1s

This commit is contained in:
2026-07-06 09:25:16 +07:00
parent 83018639fa
commit d7a49d2b5c
3 changed files with 20 additions and 2 deletions

View File

@@ -457,6 +457,10 @@ export const ClassWorkspace: React.FC<ClassWorkspaceProps> = ({ classId, sourceT
avatar: st.avatar,
}))}
onlineIds={onlineIds}
onStudentClick={(rkId) => {
const orig = students.find((st) => st.rkId === rkId);
if (orig) setSelectedStudent(orig);
}}
/>
) : (
<div className="session-logs-panel">

View File

@@ -926,6 +926,10 @@ export const ExamRoomWorkspace: React.FC<Props> = ({ examId, onBack }) => {
avatar: s.avatar,
}))}
onlineIds={onlineIds}
onStudentClick={(rkId) => {
const orig = students.find((s) => s.studentRkId === rkId);
if (orig) setSelectedStudent(toStudentItem(orig));
}}
/>
) : activeSubTab === 'grid' ? (
<ExamGridProctor

View File

@@ -11,6 +11,7 @@ interface WorkspaceSeatingChartProps {
avatar?: string;
}[];
onlineIds: number[];
onStudentClick?: (studentRkId: number) => void;
}
interface SeatingLayout {
@@ -25,6 +26,7 @@ export const WorkspaceSeatingChart: React.FC<WorkspaceSeatingChartProps> = ({
workspaceId,
students,
onlineIds,
onStudentClick,
}) => {
const [layout, setLayout] = useState<SeatingLayout | null>(null);
const [templates, setTemplates] = useState<SeatingTemplate[]>([]);
@@ -329,7 +331,14 @@ export const WorkspaceSeatingChart: React.FC<WorkspaceSeatingChartProps> = ({
<span style={{ fontSize: '0.72rem', color: '#9ca3af', fontWeight: 600 }}>Khóa</span>
</div>
) : student ? (
<div style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', textAlign: 'center', width: '100%' }}>
<div
style={{ display: 'flex', flexDirection: 'column', alignItems: 'center', textAlign: 'center', width: '100%', cursor: (!isEditingStructure && onStudentClick) ? 'pointer' : 'inherit' }}
onClick={() => {
if (!isEditingStructure && onStudentClick) {
onStudentClick(student.rkId);
}
}}
>
{!isEditingStructure && (
<button
onClick={(e) => { e.stopPropagation(); handleUnseat(key); }}
@@ -611,6 +620,7 @@ export const WorkspaceSeatingChart: React.FC<WorkspaceSeatingChartProps> = ({
key={s.rkId}
draggable
onDragStart={(e) => handleDragStart(e, `unseated:${s.rkId}`)}
onClick={() => onStudentClick && onStudentClick(s.rkId)}
style={{
display: 'flex',
alignItems: 'center',
@@ -619,7 +629,7 @@ export const WorkspaceSeatingChart: React.FC<WorkspaceSeatingChartProps> = ({
border: '1px solid var(--border-color)',
borderRadius: '8px',
backgroundColor: '#ffffff',
cursor: 'grab',
cursor: onStudentClick ? 'pointer' : 'grab',
transition: 'var(--transition)',
userSelect: 'none',
boxShadow: 'var(--shadow-sm)',