diff --git a/js/libs/ui-shared/src/controls/table/KeycloakDataTable.tsx b/js/libs/ui-shared/src/controls/table/KeycloakDataTable.tsx index ab00d57a498..0a698c68c05 100644 --- a/js/libs/ui-shared/src/controls/table/KeycloakDataTable.tsx +++ b/js/libs/ui-shared/src/controls/table/KeycloakDataTable.tsx @@ -75,15 +75,34 @@ type DataTableProps = { type CellRendererProps = { row: IRow; + index?: number; + actions?: IActions; + actionResolver?: IActionsResolver; }; const isRow = (c: ReactNode | IRowCell): c is IRowCell => !!c && (c as IRowCell).title !== undefined; -const CellRenderer = ({ row }: CellRendererProps) => - row.cells!.map((c, i) => ( - {(isRow(c) ? c.title : c) as ReactNode} - )); +const CellRenderer = ({ + row, + index, + actions, + actionResolver, +}: CellRendererProps) => ( + <> + {row.cells!.map((c, i) => ( + {(isRow(c) ? c.title : c) as ReactNode} + ))} + {(actions || actionResolver) && ( + + + + )} + +); const ExpandableRowRenderer = ({ row }: CellRendererProps) => row.cells!.map((c, i) => ( @@ -212,15 +231,12 @@ function DataTable({ }} /> )} - - {(actions || actionResolver) && ( - - - - )} + ))} @@ -242,7 +258,12 @@ function DataTable({ }, }} /> - + ) : (