--- import { type Lang } from '@/types/i18n'; import { useTranslations } from '@/i18n/utils'; export interface Props { lang: Lang; publishDate?: string; readingTime?: number; tags?: string[]; tagId?: string[]; category?: string | string[]; categoryId?: string[] | string; className?: string; } const { lang, publishDate, readingTime, tags, tagId, category, categoryId, className = '' } = Astro.props; const t = useTranslations(lang); /** * Format date according to locale */ const formatDate = (dateString: string) => { const date = new Date(dateString); return date.toLocaleDateString(lang === 'zh' ? 'zh-CN' : 'en-US', { year: 'numeric', month: 'long', day: 'numeric' }); }; /** * Get reading time text based on language */ const getReadingTimeText = (minutes: number) => { if (lang === 'zh') { return `${minutes} 分钟阅读`; } return `${minutes} min read`; }; ---