Deploy edu.mstaut.ir / deploy (push) Has been cancelled
Production already has migrations through 008; 009 only updates four seed labels by id. Faculty sync remains upsert-by-email/name and does not wipe curated data. Co-authored-by: Cursor <cursoragent@cursor.com>
33 lines
993 B
TypeScript
33 lines
993 B
TypeScript
import Image from "next/image";
|
|
|
|
/** Card media: banner image when set; otherwise course title on themed surface. */
|
|
export function CourseCardBanner({
|
|
title,
|
|
bannerUrl,
|
|
}: {
|
|
title: string;
|
|
bannerUrl?: string | null;
|
|
}) {
|
|
const hasBanner = Boolean(bannerUrl?.trim());
|
|
|
|
return (
|
|
<div className="pointer-events-none relative aspect-video overflow-hidden bg-primary-foreground/10">
|
|
{hasBanner ? (
|
|
<Image
|
|
src={bannerUrl!}
|
|
alt=""
|
|
fill
|
|
className="object-contain transition-transform duration-300 group-hover:scale-[1.03]"
|
|
sizes="(max-width:768px) 100vw, 33vw"
|
|
/>
|
|
) : (
|
|
<div className="flex h-full items-center justify-center bg-gradient-to-br from-primary-foreground/15 to-primary-foreground/5 px-4">
|
|
<p className="line-clamp-3 text-center text-sm font-bold leading-6 text-primary-foreground/90 sm:text-base">
|
|
{title}
|
|
</p>
|
|
</div>
|
|
)}
|
|
</div>
|
|
);
|
|
}
|