File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
File name
Commit message
Commit date
import type {BoardListItem} from "../../type/board.types.ts";
import type {SearchParams} from "../../../../../type/searchParams.ts";
import {EmptyRow} from "../../../../component/EmptyRow.tsx";
import {BoardListTableHeader} from "./BoardListTableHeader.tsx";
import {BoardListTableRow} from "./BoardListTableRow.tsx";
interface BoardListTableProps {
items: BoardListItem[]
params: SearchParams
onChange: (params: SearchParams) => void
totalItems: number
currentPage: number
totalPages: number
isAllChecked: boolean
isPartiallyChecked: boolean
isChecked: (id: string) => boolean
onCheck: (id: string, checked: boolean) => void
onCheckAll: (checked: boolean) => void
onDetail: (bbsId: string) => void
onArticleList: (bbsId: string) => void
onPreview: (bbsId: string) => void
}
export function BoardListTable({
items,
params,
onChange,
totalItems,
currentPage,
totalPages,
isAllChecked,
isPartiallyChecked,
isChecked,
onCheck,
onCheckAll,
onDetail,
onArticleList,
onPreview
}: BoardListTableProps) {
return (
<div className="table table_type_cols">
<table>
<BoardListTableHeader
params={params}
onChange={onChange}
checked={isAllChecked}
indeterminate={isPartiallyChecked}
onCheckAll={onCheckAll}
/>
<tbody>
{items.length > 0 ?
items.map((item, index) => (
<BoardListTableRow
key={item.bbsId}
item={item}
index={index}
searchParams={params}
totalItems={totalItems}
currentPage={currentPage}
totalPages={totalPages}
checked={isChecked(item.bbsId)}
onCheck={onCheck}
onDetail={onDetail}
onArticleList={onArticleList}
onPreview={onPreview}
/>))
: (<EmptyRow colSpan={9}/>)
}
</tbody>
</table>
</div>
)
}