import React from 'react'; import Link from 'next/link'; function formatDate(date: Date): string { return new Intl.DateTimeFormat('en-US', { year: 'numeric', month: 'long', day: 'numeric' }).format(date); } export default function ArticlePreview({ title, description, createdAt, path, imageUrl, accentColor = '#2563eb', theme = 'LIGHT' }: { title: string description: string createdAt: Date path: string imageUrl: string | null accentColor?: string theme?: 'LIGHT' | 'DARK' }) { const colors = theme === 'DARK' ? { background: '#2d3748', text: '#e2e8f0', description: '#cbd5e0', date: '#a0aec0', placeholderBg: '#4a5568', placeholderColor: '#cbd5e0', boxShadow: '0 4px 6px -1px rgba(0,0,0,0.4), 0 2px 4px -1px rgba(0,0,0,0.3)', } : { background: '#ffffff', text: '#2d3748', description: '#718096', date: '#a0aec0', placeholderBg: '#f7fafc', placeholderColor: '#cbd5e0', boxShadow: '0 4px 6px -1px rgba(0,0,0,0.1), 0 2px 4px -1px rgba(0,0,0,0.06)', }; return (
{imageUrl ? ( {title} ) : (
📷
)}

{title}

{description}

{formatDate(createdAt)}

) }