import Image from "next/image"; import Link from "next/link"; import { ArrowRight, Play, PlayCircle } from "lucide-react"; import { getTrack } from "@/lib/tracks"; import type { TutorialMeta } from "@/lib/tutorial-types"; import { cn } from "@/lib/utils"; export function TrackTag({ track, className }: { track: string; className?: string }) { const t = getTrack(track); if (!t) return null; return ( {t.name} ); } export function TutorialMetaLine({ tutorial }: { tutorial: TutorialMeta }) { return (
· {tutorial.level} · {tutorial.minutes} min {tutorial.video ? "watch" : "read"} {tutorial.draft && }
); } export function DraftBadge() { return Draft; } const chip = "rounded-full border border-foreground/10 bg-background/70 px-2.5 py-1 font-mono text-[10.5px] font-medium uppercase tracking-[0.08em] text-foreground backdrop-blur"; const cardFrame = "group overflow-hidden rounded-2xl border border-border bg-card transition duration-500 [transition-timing-function:cubic-bezier(0.2,0.7,0,1)] hover:-translate-y-1 hover:border-[var(--tc)] hover:shadow-[0_24px_60px_-20px_var(--card-glow)]"; // One tutorial as a card: cover image, track, title, description and a clear call to action export function TutorialCard({ tutorial, className }: { tutorial: TutorialMeta; className?: string }) { const track = getTrack(tutorial.track); const video = !!tutorial.video; return (
{tutorial.level} {video && ( Video )} {tutorial.draft && Draft}

{tutorial.title}

{tutorial.description}

{tutorial.minutes} min {video ? "watch" : "read"} {video ? "Watch" : "Read"}
); } // Cards in a responsive grid export function TutorialGrid({ tutorials, className }: { tutorials: TutorialMeta[]; className?: string }) { return (
{tutorials.map((t) => ( ))}
); } // A tutorial with a video: its poster beside the title (or above it when compact) and a Watch link function FeaturedTutorial({ tutorial, compact }: { tutorial: TutorialMeta; compact?: boolean }) { const track = getTrack(tutorial.track); return (

{tutorial.title}

{tutorial.description}

{tutorial.draft && }
{tutorial.level} · {tutorial.minutes} min watch Watch
); } // Tutorials with videos get the room; pass only those. Compact puts two smaller cards per row on anything wider than a phone export function FeaturedTutorials({ tutorials, compact, className, }: { tutorials: TutorialMeta[]; compact?: boolean; className?: string; }) { if (tutorials.length === 0) return null; return (

Featured videos

{tutorials.map((t) => ( ))}
); } // Written tutorials as plain text rows, with no cover image export function TutorialRows({ tutorials }: { tutorials: TutorialMeta[] }) { return ( ); }