feat: 게시물 목록 댓글 갯수 표시

This commit is contained in:
2025-05-09 17:51:07 +09:00
parent 697ac34f65
commit c41058dae9
2 changed files with 9 additions and 2 deletions
@@ -28,6 +28,7 @@ export interface Post {
atflCd: string;
regDt: string;
rgtrNm: string;
cmntCnt: number;
}
export interface PostInfo extends Post {
@@ -47,12 +47,12 @@ export const columns: ColumnDef<Post & { isUpndFixPost?: boolean }>[] = [
accessorKey: "pstTtl",
header: "제목",
cell: ({ row }) => {
const { ansPstn, pstTtl, inqNocs } = row.original;
const { ansPstn, pstTtl, inqNocs, cmntCnt } = row.original;
return (
<div
className="flex min-w-[20vw] items-center gap-2 text-left"
style={{ paddingInlineStart: `${ansPstn * 10}px` }}
style={{ paddingInlineStart: `${(ansPstn - 1) * 20}px` }}
>
{ansPstn > 0 && (
<div className="flex items-center gap-1">
@@ -67,6 +67,12 @@ export const columns: ColumnDef<Post & { isUpndFixPost?: boolean }>[] = [
<Badge color="blue">NEW</Badge>
)}
{pstTtl}
{cmntCnt > 0 && (
<div className="ml-4 flex items-end gap-2">
<i className="diveicon di-chat-box-left-text text-gray-400" />
<span className="text-gray-400">{cmntCnt}</span>
</div>
)}
</div>
);
},