Skip to content

Commit

Permalink
refactor: passing down row props to the datatable rows
Browse files Browse the repository at this point in the history
  • Loading branch information
PiusKariuki committed Jan 9, 2025
1 parent 902454b commit be6cfb9
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -130,7 +130,7 @@ const ProgramsDetailedSummary: React.FC<ProgramsDetailedSummaryProps> = ({ patie
/>
)}
<DataTable rows={tableRows} headers={tableHeaders} isSortable size={isTablet ? 'lg' : 'sm'} useZebraStyles>
{({ rows, headers, getHeaderProps, getTableProps }) => (
{({ rows, headers, getHeaderProps, getTableProps, getRowProps }) => (
<TableContainer>
<Table aria-label="program enrollments" {...getTableProps()}>
<TableHead>
Expand All @@ -151,7 +151,7 @@ const ProgramsDetailedSummary: React.FC<ProgramsDetailedSummaryProps> = ({ patie
</TableHead>
<TableBody>
{rows.map((row, i) => (
<TableRow key={row.id}>
<TableRow key={row.id} {...getRowProps({ row })}>
{row.cells.map((cell) => (
<TableCell className="cds--table-column-menu" key={cell.id}>
{cell.value?.content ?? cell.value}
Expand Down

0 comments on commit be6cfb9

Please sign in to comment.