'use client'; import './style.scss'; import Link from 'next/link'; import { useSearchParams } from 'next/navigation'; import Post from '@/types/forum/post'; import { BoardListMeta } from '@/types/forum/boardMeta'; import { formatDate, isHotPost, isNewPost } from '@/lib/utils/client'; import NoticeListLayout from './NoticeListLayout'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faComment, faThumbsUp, faEye } from '@fortawesome/free-regular-svg-icons'; interface Props { boardListMeta: BoardListMeta; speaker: Post[]; notice: Post[]; list: Post[]; startIndex: number; onChange: (_: number|undefined) => void; } export default function DefaultListLayout({boardListMeta, speaker, notice, list, startIndex, onChange}: Props) { const searchParams = useSearchParams(); return ( <>
{/* 전체 공지 */} {/* 일반 공지 */} {/* 일반 글 */} {list.length > 0 && ( list.map((row, i) => { const query = Object.fromEntries(searchParams.entries()); const isNew = isNewPost(boardListMeta.isNewIcon, row); const isHot = isHotPost(boardListMeta.isHotIcon, row); const createdAt = formatDate(row.createdAt); return (
{/* PC */}
  1. {startIndex - i}
  2. {row.boardPrefix && row.boardPrefixID && ( )} {row.subject} {isNew && NEW} {isHot && HOT}
  3. {row.name || row.sid}
  4. {createdAt}
  5. {row.views}
  6. {row.likes}
{/* Mobile */}
); }) )} {list.length <= 0 && (

등록된 글이 없습니다.

)}
); }