From 6502531ad7d10962753e6f94e00b6fbb528f0789 Mon Sep 17 00:00:00 2001 From: PhuocNTB Date: Mon, 6 Jul 2026 11:04:12 +0700 Subject: [PATCH] fix tam --- management/src/components/AttendancePanel.tsx | 256 ++++++++++-------- 1 file changed, 139 insertions(+), 117 deletions(-) diff --git a/management/src/components/AttendancePanel.tsx b/management/src/components/AttendancePanel.tsx index a01b9ba..b42c763 100644 --- a/management/src/components/AttendancePanel.tsx +++ b/management/src/components/AttendancePanel.tsx @@ -42,6 +42,7 @@ export const AttendancePanel: React.FC = ({ classId }) => const [isCollapsed, setIsCollapsed] = useState(false); const [leaveRequests, setLeaveRequests] = useState([]); const [loadingLeave, setLoadingLeave] = useState(false); + const [showLeaveModal, setShowLeaveModal] = useState(false); const handleScroll = useCallback((e: React.UIEvent) => { const scrollTop = e.currentTarget.scrollTop; @@ -273,8 +274,33 @@ export const AttendancePanel: React.FC = ({ classId }) => + {courseId && ( + + )} @@ -342,130 +368,126 @@ export const AttendancePanel: React.FC = ({ classId }) => - {/* Leave Requests Approval Section */} - {courseId && ( -
-
-

- ✉️ Đơn xin nghỉ phép trong ca - - {leaveRequests.length} đơn - -

- -
- - {loadingLeave ? ( -
-
-
- ) : leaveRequests.length === 0 ? ( -

- Không có đơn xin nghỉ phép nào cho ca học này trong ngày hôm nay. -

- ) : ( -
- {leaveRequests.map((req) => ( -
setShowLeaveModal(false)}> +
e.stopPropagation()}> +
+
+

✉️ Đơn xin nghỉ phép trong ca

+

+ Ca {period} ngày {date} - Giao diện duyệt đơn xin nghỉ từ cổng QLĐT portal. +

+
+
+ + +
+
+
+ {loadingLeave ? ( +
+
+
+ ) : leaveRequests.length === 0 ? ( +
+ Không có đơn xin nghỉ phép nào cho ca học này trong ngày hôm nay. +
+ ) : ( + leaveRequests.map((req) => ( +
+
+
+
{req.student.fullName}
+ {req.student.studentCode} + + {req.status} + +
+ + {req.status === 'Đang chờ' && ( +
+ + +
+ )}
- {req.status === 'Đang chờ' && ( -
- - + 🖼️ Xem ảnh minh chứng phép +
)}
- -
- Lý do nghỉ: {req.note || 'Không có ghi chú'} -
- - {req.reasonImage && ( - - )} -
- ))} + )) + )}
- )} +
)}