From eceee79ab3bd7158015d7d7c41c88e2d669879db Mon Sep 17 00:00:00 2001 From: ugoocreates-pixel Date: Sun, 30 Aug 2026 08:04:04 +0100 Subject: [PATCH] fix: thread actual row index to col.render in Table --- src/components/ui/Table.tsx | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/components/ui/Table.tsx b/src/components/ui/Table.tsx index c2fc2fc6..dbb76902 100644 --- a/src/components/ui/Table.tsx +++ b/src/components/ui/Table.tsx @@ -43,6 +43,7 @@ export interface TableProps { interface TableRowProps { row: T; rowId: string; + index: number; columns: ColumnDef[]; onRowClick?: (row: T) => void; onRowDoubleTap?: (row: T) => void; @@ -58,6 +59,7 @@ interface TableRowProps { function TableRow({ row, rowId, + index, columns, onRowClick, onRowDoubleTap, @@ -229,7 +231,7 @@ function TableRow({ style={style} > {col.render - ? col.render(row, 0) + ? col.render(row, index) : (row[col.key as keyof T] as unknown as React.ReactNode)} ); @@ -532,13 +534,14 @@ export function Table({ No data available ) : ( - pageItems.map((row) => { + pageItems.map((row, index) => { const id = getRowId(row); return (