'use client' import type { TrainingAssignment } from '@/lib/sdk/training/types' interface CertificatesViewProps { certificates: TrainingAssignment[] onDownloadPDF: (certId: string) => void } export function CertificatesView({ certificates, onDownloadPDF }: CertificatesViewProps) { if (certificates.length === 0) { return (
Noch keine Zertifikate vorhanden. Schliessen Sie eine Schulung mit Quiz ab.
) } return (
{certificates.map(cert => (

{cert.module_title}

Bestanden

Mitarbeiter: {cert.user_name}

Abschluss: {cert.completed_at ? new Date(cert.completed_at).toLocaleDateString('de-DE') : '-'}

{cert.quiz_score != null &&

Ergebnis: {Math.round(cert.quiz_score)}%

}

ID: {cert.certificate_id?.substring(0, 12)}

{cert.certificate_id && ( )}
))}
) }