import Link from 'next/link'; import { ArrowUpRight, Calendar, Edit2, Trash2 } from 'lucide-react'; import { decodeHtmlEntities } from '@/lib/utils'; 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; isAdmin?: boolean; imageAspect?: string; } export const NewsCard = ({ id, slug, titulo: rawTitulo, resumen: rawResumen, tipo, fecha, imagenUrl, showCategory = false, showFooterDate = false, showFooterButton = false, footerText, isAdmin = false, imageAspect = 'aspect-video' }: NewsCardProps) => { const titulo = decodeHtmlEntities(rawTitulo); // Strip HTML tags safely for a plain text excerpt const plainTextResumen = (rawResumen || '').replace(/<[^>]*>?/gm, ' ').replace(/\s+/g, ' ').trim(); const resumen = decodeHtmlEntities(plainTextResumen); // Formatear fecha const fechaObj = new Date(fecha); const fechaFormateada = fechaObj.toLocaleDateString('es-ES', { day: '2-digit', month: 'short', year: 'numeric' }); return (
{resumen}
{/* Footer del card */} {(showFooterDate || footerText) && (