| 1 | import ImageWithLoader from "@/components/loadingimage"; |
| 2 | import BackButton from "@/components/shared/back |
| 3 | import { Projects } |
| 4 | import { upperFirst } |
| 5 | import { Metadata } |
| 6 | import { FiExternalLink, FiGithub |
| 7 | |
| 8 | export async function generateStaticParams |
| 9 | return Projects.map |
| 10 | name: encodeURIComponent(p |
| 11 | })); |
| 12 | } |
| 13 | interface Props { |
| 14 | params: { |
| 15 | name: string |
| 16 | }; |
| 17 | } |
| 18 | |
| 19 | export async function generateMetadata |
| 20 | const project = |
| 21 | (p) => |
| 22 | )!; |
| 23 | |
| 24 | return { |
| 25 | title: project.name |
| 26 | description: project.description |
| 27 | openGraph: { |
| 28 | type: "website", |
| 29 | title: project.name |
| 30 | description: project.description |
| 31 | images: [ |
| 32 | { |
| 33 | url: project.image |
| 34 | width: project.image |
| 35 | height: project.image |
| 36 | alt: project.image |
| 37 | }, |
| 38 | ], |
| 39 | }, |
| 40 | twitter: { |
| 41 | card: "summary_large_image", |
| 42 | site: "@gurpalsingh287", |
| 43 | }, |
| 44 | }; |
| 45 | } |
| 46 | |
| 47 | async function ProjectPage( |
| 48 | const project = |
| 49 | (p) => |
| 50 | )!; |
| 51 | return ( |
| 52 | <div className="min-h-screen lg:pt-20 lg:p-0 p-5 container items-center justify-center flex-col lg:max-w-xl overflow-hidden |
| 53 | <BackButton /> |
| 54 | |
| 55 | <ImageWithLoader |
| 56 | className="mx-auto rounded-md mt-5 object-cover w-full h-[unset]" |
| 57 | src={project.image |
| 58 | alt={project.image |
| 59 | loading="eager" |
| 60 | width={project.image |
| 61 | height={project.image |
| 62 | /> |
| 63 | |
| 64 | {project.image.source |
| 65 | <p className="text-center text-gray-400 |
| 66 | Source: {project.image.source |
| 67 | </p> |
| 68 | ) : null} |
| 69 | <div className="flex flex-row items-center my-5 |
| 70 | <h1 className="text-2xl font-bold text-left |
| 71 | <div className="flex flex-row items-center flex-nowrap ml-auto gap-2 |
| 72 | {Object.keys(project |
| 73 | <a |
| 74 | href={project.urls |
| 75 | target="_blank" |
| 76 | rel="noreferrer" |
| 77 | key={key} |
| 78 | className="flex flex-row items-center justify-start gap-2.5 |
| 79 | text-white transition duration-300 ease-in-out |
| 80 | bg-neutral-700 hover:bg-neutral-900 rounded-md px-3 py-2.5" |
| 81 | > |
| 82 | {key === "githubUrl |
| 83 | <FiGithub className=" |
| 84 | ) : ( |
| 85 | <FiExternalLink className=" |
| 86 | )} |
| 87 | </a> |
| 88 | ))} |
| 89 | </div> |
| 90 | </div> |
| 91 | |
| 92 | <div className="flex flex-col items-start justify-start gap-2.5 |
| 93 | <p className="text-lg text-left text-gray-300 |
| 94 | <div className="flex flex-row flex-wrap items-center justify-start gap-2.5 |
| 95 | {project.tags?.map |
| 96 | <span |
| 97 | key={tag} |
| 98 | className=" text-sm bg-neutral-200 text-black font-medium rounded-xl px-2 py-1" |
| 99 | > |
| 100 | {upperFirst(tag)} |
| 101 | </span> |
| 102 | ))} |
| 103 | </div> |
| 104 | </div> |
| 105 | </div> |
| 106 | ); |
| 107 | } |
| 108 | |
| 109 | export default ProjectPage; |