{doc.metadata.title}
{doc.metadata.description}
'use client'; import { ContentItem } from '../lib/content'; interface DocumentListProps { documents: ContentItem[]; currentLang: string; } export function DocumentList({ documents, currentLang }: DocumentListProps) { const formatDate = (dateString: string) => { const date = new Date(dateString); return date.toLocaleDateString(currentLang === 'en' ? 'en-US' : 'zh-CN', { year: 'numeric', month: 'long', day: 'numeric', }); }; const getCategoryColor = (category: string) => { const colors = { 入门指南: 'bg-green-100 text-green-800', 配置: 'bg-blue-100 text-blue-800', 内容: 'bg-purple-100 text-purple-800', 部署: 'bg-orange-100 text-orange-800', 'Getting Started': 'bg-green-100 text-green-800', Configuration: 'bg-blue-100 text-blue-800', Content: 'bg-purple-100 text-purple-800', Deployment: 'bg-orange-100 text-orange-800', }; return colors[category] || 'bg-gray-100 text-gray-800'; }; if (documents.length === 0) { return (
{currentLang === 'en' ? 'No documents found' : '暂无文档'}
{doc.metadata.description}