-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCertifications.jsx
More file actions
59 lines (57 loc) · 2.01 KB
/
Copy pathCertifications.jsx
File metadata and controls
59 lines (57 loc) · 2.01 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import useFetcher from "../hooks/useFetcher";
export default function Certifications() {
const { data: certifications, error, loading } = useFetcher("certifications");
if(loading)
return (
<p className="text-center text-text-light dark:text-text-dark text-lg py-16">
Loading certifications...
</p>
);
if(error || !certifications)
return (
<p className="text-center text-red-500 text-lg py-16">
{error || "Failed to load certifications"}
</p>
);
return (
<div className="p-6 mt-16">
<h1 className="text-3xl font-bold text-heading-light dark:text-heading-dark mb-6">
Certifications
</h1>
{certifications.length === 0 ? (
<p className="text-text-light dark:text-text-dark">No certifications yet.</p>
) : (
<ul className="space-y-4">
{certifications.map((cert) => (
<li
key={cert._id}
className="p-4 rounded-lg border border-primary-light/20 dark:border-primary-dark/20
bg-surface-light dark:bg-surface-dark shadow-sm hover:shadow-md transition"
>
<h2 className="text-xl font-semibold text-primary-light dark:text-primary-dark">
{cert.title}
</h2>
<p className="text-text-light dark:text-text-dark">Issued By{cert.issuer}</p>
<p className="text-sm text-gray-500 dark:text-gray-400">
Issued Date{cert.date}
</p>
<p className="text-sm text-gray-500 dark:text-gray-400">
Expiry Date{cert.expiry}
</p>
{cert.link && (
<a
href={cert.link}
target="_blank"
rel="noopener noreferrer"
className="text-accent-light dark:text-accent-dark hover:underline"
>
View Certificate
</a>
)}
</li>
))}
</ul>
)}
</div>
);
}