import Link from "next/link"; import { CmsImage } from "@/components/atoms/CmsImage"; import { ArrowUpLeft, MapPin, Wifi } from "lucide-react"; import { Card, CardContent, CardDescription, CardHeader, CardTitle, } from "@/components/ui/card"; import { blurDataURL } from "@/lib/images"; import type { Program } from "@/lib/types"; import { cn } from "@/lib/utils"; export function ProgramCard({ program, className, }: { program: Program; className?: string; }) { return ( {program.tagline ? (

{program.tagline}

) : null} {program.title}
{program.blurb} جزئیات برنامه
); } export function ArticleCard({ title, category, excerpt, imageUrl, href, featured = false, variant = "grid", }: { title: string; category: string; excerpt: string; imageUrl: string; href: string; featured?: boolean; variant?: "grid" | "list"; }) { if (variant === "list") { return (

{category}

{title}

{excerpt}

مطالعه مقاله
); } return (

{category}

{title}

{featured ? (

{excerpt}

) : null}
); } export function EventCard({ title, startDate, endDate, location, href, variant = "home", }: { title: string; startDate: string; endDate: string | null; location: string; href: string; variant?: "home" | "list"; }) { const start = new Date(startDate); const end = endDate ? new Date(endDate) : null; const day = start.toLocaleDateString("fa-IR", { day: "numeric" }); const month = start.toLocaleDateString("fa-IR", { month: "short" }); const endDay = end?.toLocaleDateString("fa-IR", { day: "numeric" }); const endMonth = end?.toLocaleDateString("fa-IR", { month: "short" }); const isOnline = /آنلاین|online/i.test(location); const body = ( <>

{month}

{day}

{end ? ( <> تا

{endMonth}

{endDay}

) : null}

{title}

{isOnline ? ( ) : ( )} {location}

); if (variant === "list") { return ( {body} ); } return (
{body}
); } export function IntersectionCard({ title, description, href, imageUrl, }: { title: string; description: string; href: string; imageUrl: string; }) { return (

{title}

{description}

); }