|
| 1 | +import PageTransitionWrapper from "@/components/Animate/PageTransitionWrapper/PageTransitionWrapper"; |
| 2 | +import Container from "@/components/Common/Container/Container"; |
| 3 | +import SpacingDivider from "@/components/Common/SpacingDivider/SpacingDivider"; |
| 4 | +import APP_CONFIG from "@/config/config"; |
| 5 | +import { allClasses } from "contentlayer/generated"; |
| 6 | +import { Metadata } from "next"; |
| 7 | + |
| 8 | +export const metadata: Metadata = { |
| 9 | + title: `Classes | ${APP_CONFIG.title}`, |
| 10 | + description: |
| 11 | + "Explore verified tech classes in Myanmar curated by the MMSWE community.", |
| 12 | + openGraph: { |
| 13 | + title: `Classes | ${APP_CONFIG.title}`, |
| 14 | + description: |
| 15 | + "Explore verified tech classes in Myanmar curated by the MMSWE community.", |
| 16 | + images: "https://mmswe.com/images/mmswe-seo.png", |
| 17 | + }, |
| 18 | +}; |
| 19 | + |
| 20 | +const ClassesPage = async () => { |
| 21 | + const classes = [...allClasses].sort((a, b) => a.title.localeCompare(b.title)); |
| 22 | + |
| 23 | + return ( |
| 24 | + <PageTransitionWrapper> |
| 25 | + <Container> |
| 26 | + <section className="py-16"> |
| 27 | + <div className="max-w-3xl"> |
| 28 | + <p className="font-mono text-xs uppercase tracking-[0.25em] text-zinc-500"> |
| 29 | + Verified Registry |
| 30 | + </p> |
| 31 | + <h1 className="mt-4 font-display text-4xl font-bold text-zinc-100 sm:text-5xl"> |
| 32 | + Classes |
| 33 | + </h1> |
| 34 | + <p className="mt-4 max-w-2xl text-base leading-7 text-zinc-400"> |
| 35 | + A trust-first, community-curated directory of tech classes in |
| 36 | + Myanmar. Listings are reviewed before publication. |
| 37 | + </p> |
| 38 | + </div> |
| 39 | + |
| 40 | + {classes.length === 0 ? ( |
| 41 | + <div className="mt-12 rounded-3xl border border-white/10 bg-surface/50 p-8 text-zinc-300"> |
| 42 | + <h2 className="font-display text-2xl font-semibold text-zinc-100"> |
| 43 | + No classes yet |
| 44 | + </h2> |
| 45 | + <p className="mt-3 max-w-2xl text-sm leading-6 text-zinc-400"> |
| 46 | + Verified class listings will appear here after maintainers review |
| 47 | + and approve class submissions. |
| 48 | + </p> |
| 49 | + </div> |
| 50 | + ) : ( |
| 51 | + <div className="mt-12 grid gap-4"> |
| 52 | + {classes.map((classItem) => ( |
| 53 | + <article |
| 54 | + key={classItem._id} |
| 55 | + className="rounded-3xl border border-white/10 bg-surface/50 p-6 transition-colors hover:border-white/20" |
| 56 | + > |
| 57 | + <div className="flex flex-col gap-4 sm:flex-row sm:items-start sm:justify-between"> |
| 58 | + <div className="flex-1"> |
| 59 | + <div className="flex flex-wrap items-center gap-2"> |
| 60 | + <h2 className="font-display text-2xl font-semibold text-zinc-100"> |
| 61 | + {classItem.title} |
| 62 | + </h2> |
| 63 | + <span className="rounded-full border border-prism-cyan/30 bg-prism-cyan/10 px-3 py-1 text-xs font-medium text-prism-cyan"> |
| 64 | + {classItem.status} |
| 65 | + </span> |
| 66 | + <span className="rounded-full border border-white/15 px-3 py-1 text-xs font-medium text-zinc-300"> |
| 67 | + {classItem.classType} |
| 68 | + </span> |
| 69 | + </div> |
| 70 | + |
| 71 | + <p className="mt-3 text-sm leading-6 text-zinc-400"> |
| 72 | + {classItem.description} |
| 73 | + </p> |
| 74 | + |
| 75 | + <p className="mt-3 text-sm text-zinc-300"> |
| 76 | + Instructor: {classItem.instructorName} |
| 77 | + </p> |
| 78 | + |
| 79 | + <div className="mt-4 flex flex-wrap gap-2"> |
| 80 | + {classItem.tags.map((tag) => ( |
| 81 | + <span |
| 82 | + key={`${classItem._id}-${tag}`} |
| 83 | + className="rounded-full border border-white/15 px-3 py-1 text-xs text-zinc-300" |
| 84 | + > |
| 85 | + {tag} |
| 86 | + </span> |
| 87 | + ))} |
| 88 | + </div> |
| 89 | + </div> |
| 90 | + |
| 91 | + <div className="flex flex-col gap-2 sm:items-end"> |
| 92 | + <a |
| 93 | + href={classItem.classLink} |
| 94 | + target="_blank" |
| 95 | + rel="noopener noreferrer" |
| 96 | + className="inline-flex items-center justify-center rounded-full border border-prism-cyan/40 px-4 py-2 text-sm font-medium text-prism-cyan transition-colors hover:border-prism-cyan hover:bg-prism-cyan/10" |
| 97 | + > |
| 98 | + Official Link |
| 99 | + </a> |
| 100 | + </div> |
| 101 | + </div> |
| 102 | + </article> |
| 103 | + ))} |
| 104 | + </div> |
| 105 | + )} |
| 106 | + </section> |
| 107 | + |
| 108 | + <SpacingDivider size="lg" /> |
| 109 | + </Container> |
| 110 | + </PageTransitionWrapper> |
| 111 | + ); |
| 112 | +}; |
| 113 | + |
| 114 | +export default ClassesPage; |
0 commit comments