'use client'; import './style.scss'; import Link from 'next/link'; import { useSearchParams } from 'next/navigation'; import { useMemo } from 'react'; import Post from '@/types/forum/post'; import { BoardListMeta } from '@/types/forum/boardMeta'; import { formatDate, isNewPost } from '@/lib/utils/client'; import NoticeListLayout from './NoticeListLayout'; import { FontAwesomeIcon } from '@fortawesome/react-fontawesome'; import { faComment } from '@fortawesome/free-regular-svg-icons'; interface Props { boardListMeta: BoardListMeta; notice?: Post[]; list: Post[]; startIndex?: number; onChange?: (_: number|undefined) => void; } export default function QnAListLayout({boardListMeta, notice = [], list, startIndex, onChange}: Props) { const searchParams = useSearchParams(); const query = useMemo(() => Object.fromEntries(searchParams.entries()), [searchParams]); return ( <>
{/* 일반 공지 */} {/* 일반 글 */} {list.length > 0 && ( list.map((row, i) => { const isNew = isNewPost(boardListMeta.isNewIcon, row); const createdAt = formatDate(row.createdAt); const postViewUrl = {pathname: '/post/' + row.id, query}; return (
{/* PC */}
  1. {startIndex !== undefined ? startIndex - i : i + 1}
  2. {row.boardPrefix && row.boardPrefixID && onChange && ( )} {row.subject} {row.comments > 0 && ([{row.comments}])} {isNew && NEW}
  3. {row.name || row.sid}
  4. {!row.isReply ? ( 대기 ) : ( 완료 )}
  5. {createdAt}
{/* Mobile */}
); }) )} {list.length <= 0 && (

1:1문의 글이 없습니다.

)}
); }