Skip to content

Commit

Permalink
add (subrows) num
Browse files Browse the repository at this point in the history
  • Loading branch information
KevinVandy committed Jan 6, 2024
1 parent 6f24453 commit 4f66075
Showing 1 changed file with 2 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -161,11 +161,13 @@ function makeRowExpandColumn<TData extends MRT_RowData>(
return {
Cell: ({ row, table }) => {
const expandButtonProps = { row, table };
const subRowsLength = row.subRows?.length ?? 0;
if (tableOptions.groupedColumnMode === 'remove') {
return (
<Stack alignItems="center" flexDirection="row" gap="0.25rem">
<MRT_ExpandButton {...expandButtonProps} />
<span>{row.groupingValue as ReactNode}</span>
{!!subRowsLength && <span>({subRowsLength})</span>}
</Stack>
);
} else {
Expand Down

0 comments on commit 4f66075

Please sign in to comment.