import Image from "next/image"; import Link from "next/link"; type PromoVariant = "sale" | "discount" | "autumn"; export type PromoSlotOverride = { image?: string; nameFa?: string; nameEn?: string; subtext?: string; link?: string; }; type PromoCardProps = { variant: PromoVariant; href?: string; className?: string; slot?: PromoSlotOverride | null; }; const META: Record< PromoVariant, { href: string; labelFa: string } > = { sale: { href: "/products?sale=1", labelFa: "" }, discount: { href: "/products?sale=1", labelFa: "بهترین مانتوهای ما" }, autumn: { href: "/products?collection=autumn", labelFa: "کالکشن پاییزه", }, }; const CARD_SHELL = "relative flex h-[491px] w-full flex-col overflow-hidden rounded-[19px] border border-[#8e8e8e]/30"; /** Full-bleed creative when Website Images provides a slot image. */ function FullImagePromo({ href, image, alt, className, }: { href: string; image: string; alt: string; className: string; }) { return ( {alt} ); } export default function PromoCard({ variant, href, className = "", slot, }: PromoCardProps) { const meta = META[variant]; const to = slot?.link || href || meta.href; if (slot?.image) { return ( ); } if (variant === "sale") { return (
Sale

Our Season Finale

Up to 70% OFF

); } if (variant === "discount") { return (

Up TO

70%

Discount

{slot?.nameFa || meta.labelFa}

); } return (

i wanted it for

Autumn

{slot?.nameFa || meta.labelFa}

); }