import React, { memo } from "react"; import Link from "next/link"; import Image from "next/image"; import { LucideIcon } from "lucide-react"; import { isLocalUrl } from "@/utils/cn"; interface MediaCardProps { href: string; imageUrl: string | null | undefined; title: string; subtitle?: string; placeholderIcon: React.ReactNode; onClick?: (e: React.MouseEvent) => void; badge?: React.ReactNode; imageShape?: "circle" | "square"; } const MediaCard = memo(function MediaCard({ href, imageUrl, title, subtitle, placeholderIcon, onClick, badge, imageShape = "circle", }: MediaCardProps) { const content = (
{imageUrl ? ( {title} ) : ( placeholderIcon )}

{title}

{subtitle && (

{subtitle}

)}
{badge &&
{badge}
}
); if (onClick) { return content; } return {content}; }); export { MediaCard };