|
| 1 | +import Image from "next/image"; |
| 2 | +import { CertificateType } from "./types"; |
| 3 | +import { Button } from "@/components/ui/button"; |
| 4 | +import { Link } from "@/lib/navigation"; |
| 5 | +import { Linkedin, TwitterIcon } from "lucide-react"; |
| 6 | + |
| 7 | +type Props = { |
| 8 | + certificate: CertificateType; |
| 9 | +}; |
| 10 | + |
| 11 | +const Certificate = ({ certificate }: Props) => { |
| 12 | + const { _id, event, image_link, name, share_link } = certificate; |
| 13 | + return ( |
| 14 | + <div className="w-full"> |
| 15 | + <div className="p-4 my-12"> |
| 16 | + <div className="space-y-2"> |
| 17 | + <h3 className="text-hmc-primary md:text-2xl text-xl font-semibold text-center"> |
| 18 | + Terima Kasih kepada <strong className="font-extrabold">{name}</strong>! |
| 19 | + </h3> |
| 20 | + <p className="md:text-base text-sm text-center text-gray-500">Kamu telah berpartisipasi dalam acara ini.</p> |
| 21 | + </div> |
| 22 | + <div className="w-full h-full relative"> |
| 23 | + <div className="flex justify-center"> |
| 24 | + <Image |
| 25 | + src={image_link} |
| 26 | + className="my-4 rounded-lg shadow-md object-cover object-center" |
| 27 | + width="640" |
| 28 | + height="480" |
| 29 | + alt={`Sertikat ${event} - ${name}`} |
| 30 | + /> |
| 31 | + </div> |
| 32 | + <p className="md:text-base text-sm text-center text-gray-500 mb-8"> |
| 33 | + Sertifikat : <b>{_id}</b> |
| 34 | + </p> |
| 35 | + |
| 36 | + <div className="flex justify-center"> |
| 37 | + <Button asChild variant="tertiary"> |
| 38 | + <Link href={share_link} target="_blank"> |
| 39 | + UNDUH SERTIFIKAT |
| 40 | + </Link> |
| 41 | + </Button> |
| 42 | + </div> |
| 43 | + <div> |
| 44 | + <p className="md:text-base text-sm text-center text-gray-500 my-4"> |
| 45 | + <strong className="md:text-lg text-md text-black">Pamerkan</strong> sertifikat ini ke teman-temanmu! |
| 46 | + </p> |
| 47 | + |
| 48 | + <div className="flex justify-center space-x-6"> |
| 49 | + <Button variant="secondary" size="icon"> |
| 50 | + <Link |
| 51 | + href={`https://twitter.com/intent/tweet?text=Saya telah mengikuti kegiatan ${event} yang diadakan oleh Hammercode.org&url=${share_link}`} |
| 52 | + target={"_blank"} |
| 53 | + > |
| 54 | + <TwitterIcon className="w-full text-3xl text-sky-600 hover:text-sky-700" size={24} /> |
| 55 | + </Link> |
| 56 | + </Button> |
| 57 | + <Button variant="secondary" size="icon"> |
| 58 | + <Link href={`https://www.linkedin.com/shareArticle?mini=true&url=${share_link}`} target={"_blank"}> |
| 59 | + <Linkedin className="text-3xl text-sky-600 hover:text-sky-700" size={24} /> |
| 60 | + </Link> |
| 61 | + </Button> |
| 62 | + </div> |
| 63 | + </div> |
| 64 | + </div> |
| 65 | + </div> |
| 66 | + </div> |
| 67 | + ); |
| 68 | +}; |
| 69 | + |
| 70 | +export default Certificate; |
0 commit comments