({
certificate,
}: {
certificate: Certificate & { user: User; course: Course };
})
| 5 | import { useGenerateCertificate } from '@/hooks/useCertGen'; |
| 6 | |
| 7 | export const CertificateVerify = ({ |
| 8 | certificate, |
| 9 | }: { |
| 10 | certificate: Certificate & { user: User; course: Course }; |
| 11 | }) => { |
| 12 | const { certificateImageUrl } = useGenerateCertificate({ |
| 13 | certificateDetails: { |
| 14 | certificateId: certificate.id, |
| 15 | //@ts-ignore |
| 16 | course: certificate.course, |
| 17 | certificateSlug: certificate.slug, |
| 18 | }, |
| 19 | userName: certificate.user.name as string, |
| 20 | }); |
| 21 | |
| 22 | return ( |
| 23 | <div> |
| 24 | <h1 className="py-4 text-center text-4xl">100x Devs Certificate</h1> |
| 25 | <div className="mx-10 flex justify-center pb-20"> |
| 26 | <Card className="my-4"> |
| 27 | <CardContent className="w-[90vw] max-w-[800px] flex-none"> |
| 28 | {certificateImageUrl ? ( |
| 29 | <img |
| 30 | src={certificateImageUrl} |
| 31 | alt="Generated Certificate" |
| 32 | className="h-auto w-full" |
| 33 | /> |
| 34 | ) : ( |
| 35 | <div className="flex min-h-[500px] items-center justify-center"> |
| 36 | Loading... |
| 37 | </div> |
| 38 | )} |
| 39 | </CardContent> |
| 40 | |
| 41 | <div className="flex justify-center"> |
| 42 | <CardHeader> |
| 43 | <CardTitle> |
| 44 | This Certificate was issued to {certificate.user.name} for |
| 45 | completing {certificate.course.title} |
| 46 | </CardTitle> |
| 47 | </CardHeader> |
| 48 | </div> |
| 49 | </Card> |
| 50 | </div> |
| 51 | </div> |
| 52 | ); |
| 53 | }; |
nothing calls this directly
no test coverage detected