import { Award } from 'lucide-react'; import { useLanguage } from '../../contexts/LanguageContext'; import { certificationsData } from '../../config/certifications-config'; import type { Certification } from '../../data/Certification'; interface CertificationsSectionProps { title?: string; subtitle?: string; certifications?: Certification[]; } export default function CertificationsSection(props: CertificationsSectionProps = {}) { const { texts: allTexts } = useLanguage(); const texts = allTexts.certifications; const accessibilityTexts = allTexts.accessibility; // Use centralized texts as defaults, allow props to override const { title = texts.title, subtitle = texts.subtitle, certifications = certificationsData } = props; // Sort certifications by year in descending order (newest first) const sortedCertifications = [...certifications].sort((a, b) => { return Number.parseInt(b.year) - Number.parseInt(a.year); }); return (
{/* Section Header */}

{title}

{subtitle}

{/* Skip link for keyboard navigation */}
{accessibilityTexts.skipLinks.skipToContact}
{/* Certifications sorting info for screen readers */}

Certifications are sorted by year, showing the most recent first. Total: {sortedCertifications.length} certifications and qualifications.

{/* Certifications Grid */}
{sortedCertifications.map((cert, index) => (
{cert.icon ? ( {`${cert.issuer} ) : (
{cert.year}
{/* Hidden details for screen readers */}
Certification {index + 1} of {sortedCertifications.length}. {cert.name} from {cert.issuer}, completed in {cert.year}.
))}
{/* Certifications summary for screen readers */}

Certifications timeline: Spanning from {sortedCertifications.at(-1)?.year} to {sortedCertifications.at(0)?.year}, including {sortedCertifications.filter(cert => cert.issuer.includes('Udemy')).length} online courses and {sortedCertifications.filter(cert => cert.issuer.includes('TU Darmstadt')).length} academic degree.

); }