Skip to content

Commit 5ddf840

Browse files
committed
feat:create veirfied candidates and past candidates components
1 parent e962dcf commit 5ddf840

4 files changed

Lines changed: 37 additions & 17 deletions

File tree

src/app/dashboard/institution/candidates/Components/NewCandidates.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ interface CandidateData {
99
status: "Eligible" | "Unverified";
1010
}
1111

12-
const pastCandidates = () => {
12+
const NewCandidates = () => {
1313
const data: CandidateData[] = [
1414
{
1515
sn: 1,
@@ -68,4 +68,4 @@ const pastCandidates = () => {
6868
);
6969
};
7070

71-
export default pastCandidates;
71+
export default NewCandidates;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
"use client";
2+
import React from "react";
3+
4+
const PastCandidates = () => {
5+
return <div>Past candidates</div>;
6+
};
7+
8+
export default PastCandidates;
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
"use client";
2+
import React from "react";
3+
4+
const VerifiedCandidates = () => {
5+
return <div>Verified candidates</div>;
6+
};
7+
8+
export default VerifiedCandidates;
Lines changed: 19 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,28 @@
11
"use client";
22
import React, { useState } from "react";
33
import NewCandidates from "./Components/NewCandidates";
4+
import PastCandidates from "./Components/PastCandidates";
5+
import VerifiedCandidates from "./Components/VerifiedCandidates";
46

5-
const Candidates = () => {
6-
const [activeTab, setActiveTab] = useState<TabType>("new_candidates");
7+
const tabs = [
8+
{ id: "new_candidates", label: "New candidates" },
9+
{ id: "past_candidates", label: "Past candidates" },
10+
{ id: "verified_candidates", label: "Verified candidates" },
11+
] as const;
712

8-
const tabs = [
9-
{ id: "new_candidates", label: "New candidates" },
10-
{ id: "past_candidates", label: "Past candidates" },
11-
{ id: "verified_candidates", label: "Verified candidates" },
12-
] as const;
13+
type TabType = (typeof tabs)[number]["id"];
1314

14-
type TabType = (typeof tabs)[number]["id"];
15+
const CandidatesTabs = () => {
16+
const [activeTab, setActiveTab] = useState<TabType>("new_candidates");
1517

1618
const renderComponent = () => {
1719
switch (activeTab) {
1820
case "new_candidates":
1921
return <NewCandidates />;
20-
// case "past_candidates":
21-
// return <Past candidates />;
22-
// case "verified_candidates":
23-
// return <Verified candidates />;
22+
case "past_candidates":
23+
return <PastCandidates />;
24+
case "verified_candidates":
25+
return <VerifiedCandidates />;
2426
default:
2527
return null;
2628
}
@@ -33,8 +35,10 @@ const Candidates = () => {
3335
<button
3436
key={tab.id}
3537
onClick={() => setActiveTab(tab.id)}
36-
className={`px-5 py-3 rounded-md border border-neutral-900 cursor-pointer transition-all ${
37-
activeTab === tab.id ? "bg-neutral-800" : "hover:bg-neutral-800"
38+
className={`px-5 py-3 rounded-md border border-neutral-900 text-white cursor-pointer transition-all ${
39+
activeTab === tab.id
40+
? "bg-neutral-800"
41+
: "hover:bg-neutral-800"
3842
}`}
3943
>
4044
{tab.label}
@@ -48,4 +52,4 @@ const Candidates = () => {
4852
);
4953
};
5054

51-
export default Candidates;
55+
export default CandidatesTabs;

0 commit comments

Comments
 (0)