+
+ Thông tin ứng viên
+
+
+
+
+
+
+
+ {userData.display_name || "N/A"}
+
+
+ {userData.email || "Không có email"}
+
+
+
+ {application.verify_type}
+
+
+ {application.status}
+
-
-
- Nội dung ứng tuyển
-
-
Không có nội dung chữ.",
- }}
- />
-
-
-
-
- Tệp đính kèm ({mediaList.length})
-
- {mediaList.length > 0 ? (
-
- {mediaList.map((media, idx) => {
- const isImage =
- media.url?.match(/\.(jpeg|jpg|gif|png)$/i) ||
- media.mime_type?.startsWith("image/");
- return (
-
- {isImage ? (
-
- ) : (
-
-
-
- {media.original_name || "Tài liệu"}
-
-
- )}
-
- {/*
*/}
-
-
- );
- })}
-
- ) : (
-
- Không có tệp đính kèm nào.
-
- )}
-
-
- {/* KHỐI 4: GHI CHÚ ADMIN */}
-
-
- Ghi chú duyệt hồ sơ
-
-
- )}
+
+
+
+ Nội dung ứng tuyển
+
+
Không có nội dung.",
+ }}
+ />
+
+
+
+
+ Tệp đính kèm ({mediaList.length})
+
+ {mediaList.length > 0 ? (
+
+ {mediaList.map((media: any, idx: number) => {
+ const isImage = media.mime_type?.startsWith("image/");
+ return (
+
+ {isImage ? (
+
+ ) : (
+
+
+
+ {media.original_name}
+
+
+ )}
+
+
+ Xem file
+
+
+
+ );
+ })}
+
+ ) : (
+
+ Không có tệp đính kèm.
+
+ )}
+
+
+ {/* GHI CHÚ */}
+
+
+ Ghi chú duyệt hồ sơ
+
+
+
-
- {/* Chỉ hiện nút duyệt/từ chối nếu status đang là PENDING (1) */}
- {(application.status === 1 || application.status === "PENDING") && (
+ {application.status === "PENDING" && (
<>
diff --git a/src/components/tables/ApplicationTable.tsx b/src/components/tables/ApplicationTable.tsx
index 0ec1cdf..46af1d4 100644
--- a/src/components/tables/ApplicationTable.tsx
+++ b/src/components/tables/ApplicationTable.tsx
@@ -51,15 +51,29 @@ export default function ApplicationTable({
);
@@ -70,28 +84,46 @@ export default function ApplicationTable({
switch (s) {
case "1":
case "PENDING":
- return
Đang chờ;
+ return (
+
+ Đang chờ
+
+ );
case "2":
case "APPROVED":
- return
Đã duyệt;
+ return (
+
+ Đã duyệt
+
+ );
case "3":
case "REJECTED":
- return
Từ chối;
+ return (
+
+ Từ chối
+
+ );
default:
- return
{status || "N/A"};
+ return (
+
+ {status || "N/A"}
+
+ );
}
};
- const renderVerifyTypes = (verifyType: string | string[] | number | number[]) => {
+ const renderVerifyTypes = (
+ verifyType: string | string[] | number | number[],
+ ) => {
const typeMap: Record
= {
"1": "Thẻ nhận dạng nhà nghiên cứu",
- "ID_CARD": "Thẻ nhận dạng nhà nghiên cứu",
+ ID_CARD: "Thẻ nhận dạng nhà nghiên cứu",
"2": "Bằng cấp",
- "EDUCATION": "Bằng cấp",
+ EDUCATION: "Bằng cấp",
"3": "Chuyên gia",
- "EXPERT": "Chuyên gia",
+ EXPERT: "Chuyên gia",
"4": "Khác",
- "OTHER": "Khác",
+ OTHER: "Khác",
};
const typesArray = Array.isArray(verifyType) ? verifyType : [verifyType];
@@ -121,37 +153,73 @@ export default function ApplicationTable({
-
+
Người gửi (ID)
-
+
Loại xác minh
-
+
Đính kèm
-
- onSort("status")}>
+
+ onSort("status")}
+ >
Trạng thái
-
- onSort("created_at")}>
+
+ onSort("created_at")}
+ >
Ngày nộp
-
- onSort("reviewed_at")}>
+
+ onSort("reviewed_at")}
+ >
Cập nhật
-
+
Cập nhật bởi
-
+
Ghi chú
-
+
Thao tác
@@ -160,17 +228,22 @@ export default function ApplicationTable({
{data.length > 0 ? (
data.map((app) => (
-
+
- {app.user_id.slice(0, 8)}...
+ {app.user.display_name}
{renderVerifyTypes(app.verify_type)}
- {app.media?.length || 0}
+
+ {app.media?.length || 0}
+
-
+
{getStatusBadge(app.status)}
@@ -180,10 +253,17 @@ export default function ApplicationTable({
{formatDate(app.reviewed_at)}
- {app.reviewed_by || "-"}
+ {app.reviewer?.display_name || "-"}
-
- {app.review_note || "-"}
+
+ {app.review_note || "-"}
+
+ {app.review_note && (
+
+ {app.review_note}
+ {/*
*/}
+
+ )}
@@ -208,4 +291,4 @@ export default function ApplicationTable({
);
-}
\ No newline at end of file
+}
diff --git a/src/components/tables/Pagination.tsx b/src/components/tables/Pagination.tsx
index 354e804..4fa123c 100644
--- a/src/components/tables/Pagination.tsx
+++ b/src/components/tables/Pagination.tsx
@@ -9,10 +9,7 @@ const Pagination: React.FC = ({
totalPages,
onPageChange,
}) => {
- const pagesAroundCurrent = Array.from(
- { length: Math.min(3, totalPages) },
- (_, i) => i + Math.max(currentPage - 1, 1)
- );
+ const allPages = Array.from({ length: totalPages }, (_, i) => i + 1);
return (
@@ -25,7 +22,7 @@ const Pagination: React.FC
= ({
{currentPage > 3 &&
...}
- {pagesAroundCurrent.map((page) => (
+ {allPages.map((page) => (
+