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 (