Files
Aut.ManagementFaculty/src/components/molecules/CourseCardBanner.tsx
T
smhk1376andCursor 2b0db26a93
Deploy edu.mstaut.ir / deploy (push) Has been cancelled
Ship site UI checklist, move admin to /mstcontroller, and add safe taxonomy label migration.
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>
2026-10-16 16:26:21 +03:30

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>
);
}