|
| 1 | +import { Link } from "react-router-dom"; |
| 2 | +import { ArrowRight, ExternalLink } from "lucide-react"; |
| 3 | +import YouTubeCard from "@/components/YouTubeCard"; |
| 4 | +import siteData from "@/data/site-data.json"; |
| 5 | +import type { SiteData } from "@/types"; |
| 6 | + |
| 7 | +const data = siteData as SiteData; |
| 8 | + |
| 9 | +export default function YouTubeSection() { |
| 10 | + const videos = data.youtubeVideos; |
| 11 | + |
| 12 | + if (videos.length === 0) return null; |
| 13 | + |
| 14 | + return ( |
| 15 | + <section |
| 16 | + id="youtube-sessions" |
| 17 | + className="mx-auto max-w-7xl px-4 py-16 sm:px-6 lg:px-8" |
| 18 | + > |
| 19 | + <div className="mb-8 flex flex-col gap-4 sm:flex-row sm:items-end sm:justify-between"> |
| 20 | + <div> |
| 21 | + <p className="text-sm font-medium uppercase tracking-wider text-red-400"> |
| 22 | + @7oSkaa on YouTube |
| 23 | + </p> |
| 24 | + <h2 className="section-heading mt-1">YouTube Sessions</h2> |
| 25 | + <p className="mt-2 max-w-xl text-slate-400"> |
| 26 | + Watch CP Circus and session recordings on Ahmed Hossam's channel. |
| 27 | + </p> |
| 28 | + </div> |
| 29 | + <div className="flex flex-wrap gap-3"> |
| 30 | + <Link to="/youtube" className="btn-ghost"> |
| 31 | + View all {videos.length} videos |
| 32 | + <ArrowRight className="h-4 w-4" /> |
| 33 | + </Link> |
| 34 | + <a |
| 35 | + href={data.config.youtubeChannel} |
| 36 | + target="_blank" |
| 37 | + rel="noopener noreferrer" |
| 38 | + className="btn-primary" |
| 39 | + > |
| 40 | + Open Channel |
| 41 | + <ExternalLink className="h-4 w-4" /> |
| 42 | + </a> |
| 43 | + </div> |
| 44 | + </div> |
| 45 | + |
| 46 | + <div className="grid gap-6 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4"> |
| 47 | + {videos.map((video) => ( |
| 48 | + <YouTubeCard key={video.id} video={video} /> |
| 49 | + ))} |
| 50 | + </div> |
| 51 | + </section> |
| 52 | + ); |
| 53 | +} |
0 commit comments