import Link from 'next/link' import { getTranslations } from 'next-intl/server' interface ProjectCardProps { project: { id: string name: string nameEn?: string | null slug: string description: string descriptionEn?: string | null tags: Array<{ id: string name: string nameEn?: string | null slug: string }> } locale: string featured?: boolean } // Icon mapping for projects based on tags function getProjectIcon(tags: Array<{ name: string }>): string { const tagNames = tags.map(t => t.name.toLowerCase()) if (tagNames.some(t => t.includes('automation') || t.includes('workflow'))) return '⚙️' if (tagNames.some(t => t.includes('image') || t.includes('art'))) return '🎨' if (tagNames.some(t => t.includes('chat') || t.includes('assistant'))) return '💬' if (tagNames.some(t => t.includes('data') || t.includes('analysis'))) return '📊' if (tagNames.some(t => t.includes('llm') || t.includes('language'))) return '🧠' return '✨' } export async function ProjectCard({ project, locale, featured = false }: ProjectCardProps) { const t = await getTranslations('common') const icon = getProjectIcon(project.tags) const displayName = locale === 'en' && project.nameEn ? project.nameEn : project.name const displayDescription = locale === 'en' && project.descriptionEn ? project.descriptionEn : project.description // Helper to get display name for tag based on locale const getTagName = (tag: { name: string; nameEn?: string | null }) => { return locale === 'en' && tag.nameEn ? tag.nameEn : tag.name } return (
{/* Card Header */}

{displayName}

{icon}
{/* Card Description */}

{displayDescription}

{/* Card Footer */}
{/* Tags */}
{project.tags.slice(0, 3).map((tag) => ( {getTagName(tag)} ))}
{/* View Details Link */} {t('viewDetails')}{' '}
) } // Special card for "Submit Your Project" CTA export async function SubmitProjectCard({ locale }: { locale: string }) { const t = await getTranslations('project') return (
+

{t('submitProjectTitle')}

{t('submitProjectDescription')}

{t('submitNow')}
) }