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, avatar: st.avatar,
}))} }))}
onlineIds={onlineIds} onlineIds={onlineIds}
onStudentClick={(rkId) => {
const orig = students.find((st) => st.rkId === rkId);
if (orig) setSelectedStudent(orig);
}}
/> />
) : ( ) : (
<div className="session-logs-panel"> <div className="session-logs-panel">

View File

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

View File

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