import type {BoardListItem} from "../type/boardMaster.types.ts"; import type {SearchParams} from "../../../../../type/searchParams.ts"; import {CheckBox} from "../../../../component/checkbox/CheckBox.tsx"; interface BoardListTableRowProps { item: BoardListItem index: number searchParams: SearchParams totalItems: number currentPage: number totalPages: number checked: boolean onCheck: (id: string, checked: boolean) => void onDetail: (bbsId: string) => void onArticleList: (bbsId: string) => void onPreview: (bbsId: string) => void } export function BoardListTableRow({ item, index, searchParams, totalItems, currentPage, totalPages, checked, onCheck, onDetail, onArticleList, onPreview }: BoardListTableRowProps) { const rowNumber = searchParams.searchSortOrd === 'DESC' ? totalItems - (currentPage - 1) * totalPages - index : (currentPage - 1) * totalPages + (index + 1) const bbsId = item.bbsId; return ( onCheck(bbsId, nextChecked)} /> {rowNumber} {item.bbsNm} {item.menuNm} {item.newCnt}/{item.totCnt} {item.bbsTyCodeNm} {item.frstRegisterPnttm} {item.useAt === 'Y' ? ( 사용 ) : ( 미사용 )}
) }