diff --git a/app/client/packages/design-system/ads-old/src/Table/index.tsx b/app/client/packages/design-system/ads-old/src/Table/index.tsx index 295922f668..ecec66eb1c 100644 --- a/app/client/packages/design-system/ads-old/src/Table/index.tsx +++ b/app/client/packages/design-system/ads-old/src/Table/index.tsx @@ -1,4 +1,9 @@ -import { useTable, useSortBy, useExpanded } from "react-table"; +import { + useTable, + useSortBy, + useExpanded, + type Row as ReactTableRow, +} from "react-table"; import React from "react"; import styled from "styled-components"; import { Classes } from "../constants/classes"; @@ -141,8 +146,16 @@ export interface TableProps { isLoading?: boolean; loaderComponent?: JSX.Element; noDataComponent?: JSX.Element; + RowComponent?: React.ComponentType; } +const Row = ({ + children, + ...props +}: React.ComponentProps<"tr"> & { row: ReactTableRow }) => { + return {children}; +}; + function Table(props: TableProps) { const { columns, @@ -150,6 +163,7 @@ function Table(props: TableProps) { isLoading = false, loaderComponent, noDataComponent, + RowComponent = Row, } = props; const { getTableBodyProps, getTableProps, headerGroups, prepareRow, rows } = @@ -201,7 +215,7 @@ function Table(props: TableProps) { prepareRow(row); return ( - + {row.cells.map((cell, index) => { return ( ); })} - + ); }) ) : (