diff --git a/apps/site/src/app/admin/applicants/hackers/HackerApplicants.tsx b/apps/site/src/app/admin/applicants/hackers/HackerApplicants.tsx index 461f18aa..dc973f3c 100644 --- a/apps/site/src/app/admin/applicants/hackers/HackerApplicants.tsx +++ b/apps/site/src/app/admin/applicants/hackers/HackerApplicants.tsx @@ -6,6 +6,7 @@ import Box from "@cloudscape-design/components/box"; import Cards from "@cloudscape-design/components/cards"; import Header from "@cloudscape-design/components/header"; import Link from "@cloudscape-design/components/link"; +import Checkbox from "@cloudscape-design/components/checkbox"; import { useFollowWithNextLink } from "@/app/admin/layout/common"; import useHackerApplicants, { @@ -49,6 +50,15 @@ function HackerApplicants() { const acceptThreshold = thresholds?.accept; const waitlistThreshold = thresholds?.waitlist; + const [top400, setTop400] = useState(false); + + useEffect(() => { + if (top400) { + setSelectedStatuses([]); + setSelectedDecisions([]); + } + }, [top400]); + const filteredApplicants = applicantList.filter( (applicant) => (selectedStatuses.length === 0 || @@ -57,6 +67,11 @@ function HackerApplicants() { selectedDecisionValues.includes(applicant.decision || "-")), ); + const filteredApplicants400 = [...applicantList] + .filter((applicant) => applicant.avg_score !== -1) + .sort((a, b) => b.avg_score - a.avg_score) + .slice(0, 400); + useEffect(() => { const accepted = acceptThreshold ? acceptThreshold : 0; const waitlisted = waitlistThreshold ? waitlistThreshold : 0; @@ -78,7 +93,7 @@ function HackerApplicants() { setRejectCount(rejectedCount); }, [applicantList, acceptThreshold, waitlistThreshold]); - const items = filteredApplicants; + const items = top400 ? filteredApplicants400 : filteredApplicants; const counter = selectedStatuses.length > 0 || selectedDecisions.length > 0 @@ -149,24 +164,52 @@ function HackerApplicants() { } empty={emptyContent} header={ -
}> - Hacker Applicants {counter} -
- {acceptedCount} applicants with "accepted" status -
-
- {waitlistedCount} applicants with "waitlisted" status -
-
+
}> + Hacker Applicants {counter} +
+ {acceptedCount} applicants with "accepted" status +
+
+ {waitlistedCount} applicants with "waitlisted" status +
+
+ {rejectedCount} applicants with "rejected" status +
+
+ setTop400(detail.checked)} > - {rejectedCount} applicants with "rejected" status -
-
+ Show Top 400 Scores + + + {top400 && "Highest score: " + filteredApplicants400[0]?.avg_score} +
+ {top400 && + "Lowest score: " + + filteredApplicants400[filteredApplicants400.length - 1] + ?.avg_score} +
+ } /> );