import Link from 'next/link'; import { ArrowUpRight, Calendar } from 'lucide-react'; interface NewsCardProps { id: string; slug: string; titulo: string; resumen: string; tipo?: string; fecha: string; imagenUrl?: string | null; showCategory?: boolean; showFooterDate?: boolean; showFooterButton?: boolean; footerText?: string; } export const NewsCard = ({ id, slug, titulo, resumen, tipo, fecha, imagenUrl, showCategory = false, showFooterDate = true, showFooterButton = true, footerText }: NewsCardProps) => { // Formatear fecha const fechaObj = new Date(fecha); const fechaFormateada = fechaObj.toLocaleDateString('es-ES', { day: '2-digit', month: 'short', year: 'numeric' }); return ( {/* Imagen Destacada */}
{imagenUrl ? ( {titulo} ) : (
{/* No placeholder text as per user request */}
)} {/* Badge/Tag - Habilitable por prop */} {showCategory && (
{tipo?.toUpperCase() || 'NOTICIA'}
)}
{/* Contenido */}

{titulo}

{resumen}

{/* Footer del card */}
{showFooterDate ? (
{fechaFormateada}
) : ( footerText || "Ver más" )}
{showFooterButton && (
)}
); };