import Link from 'next/link'; import { ChevronRight, Eye } from 'lucide-react'; import { clsx } from 'clsx'; import { Post } from '@/types'; import StatusBadge from '@/components/ui/StatusBadge'; interface PostListItemProps { post: Post; showViews?: boolean; } const isNoticePost = (post: Post) => { return post.categoryName === '공지' || post.categoryName.toLowerCase() === 'notice'; }; const formatDate = (value: string) => { const date = new Date(value); if (Number.isNaN(date.getTime())) return ''; return new Intl.DateTimeFormat('ko-KR', { year: 'numeric', month: '2-digit', day: '2-digit', }).format(date); }; export default function PostListItem({ post, showViews = false }: PostListItemProps) { const isNotice = isNoticePost(post); return (
{post.categoryName || '미분류'}

{post.title}

{showViews && (
조회 {post.viewCount.toLocaleString()}
)}
); }