'use client'; import { useRouter } from 'next/navigation'; import PaperClipSvg from '../svgs/paperclipsvg'; import { MOCK_NOTICES } from '../admin/notices/mockData'; export default function NoticesPage() { const router = useRouter(); // 날짜 내림차순 정렬 (최신 날짜가 먼저) const rows = [...MOCK_NOTICES].sort((a, b) => b.date.localeCompare(a.date)); return (
{/* 헤더 영역 */}

공지사항

{/* 본문 영역 */}
{/* 총 건수 */}

{rows.length}

{/* 표 */}
{/* 헤더 */}
번호
제목
게시일
조회수
작성자
{/* 바디 */}
{rows.map((r, index) => { // 번호는 정렬된 목록에서의 순서 const noticeNumber = rows.length - index; return (
router.push(`/notices/${r.id}`)} onKeyDown={(e) => { if (e.key === 'Enter' || e.key === ' ') { e.preventDefault(); router.push(`/notices/${r.id}`); } }} className={[ 'grid grid-cols-[57px_1fr_140px_140px_140px] h-[48px] text-[15px] font-medium text-[#1B2027] border-t border-[#DEE1E6] hover:bg-[rgba(236,240,255,0.5)] cursor-pointer', ].join(' ')} >
{noticeNumber}
{r.title} {r.hasAttachment && ( )}
{r.date}
{r.views.toLocaleString()}
{r.writer}
); })}
); }