import Link from 'next/link'; import { ArrowRight, FolderTree } from 'lucide-react'; import EmptyState from '@/components/ui/EmptyState'; import Surface from '@/components/ui/Surface'; import { DashboardCategoryStat } from '@/types'; interface AdminDashboardCategoryHealthProps { categoryStats: DashboardCategoryStat[]; isFallback: boolean; } const formatDate = (value?: string | null) => { if (!value) return '발행 기록 없음'; const date = new Date(value); if (Number.isNaN(date.getTime())) return '발행 기록 없음'; return new Intl.DateTimeFormat('ko-KR', { year: 'numeric', month: 'short', day: 'numeric', }).format(date); }; export default function AdminDashboardCategoryHealth({ categoryStats, isFallback, }: AdminDashboardCategoryHealthProps) { return (

카테고리 상태

{categoryStats.length > 0 ? (
카테고리 최근 조회 최근 발행
{categoryStats.slice(0, 6).map((category) => ( {category.name} {category.postCount.toLocaleString()} {category.recentViewCount.toLocaleString()} {formatDate(category.lastPublishedAt)} ))}
) : ( )}
); }