Skip to content

Commit fd8dafc

Browse files
committed
wip: commit current cell progress
1 parent a29f395 commit fd8dafc

File tree

2 files changed

+18
-7
lines changed

2 files changed

+18
-7
lines changed
Lines changed: 17 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,23 @@
11
import TableCell from "@mui/material/TableCell";
2-
import { GroupsByUserId } from "api/queries/groups";
3-
import { User } from "api/typesGenerated";
2+
import { Stack } from "components/Stack/Stack";
3+
import { type Group } from "api/typesGenerated";
44

55
type GroupsCellProps = {
6-
user: User;
7-
groupsByUserId: GroupsByUserId | undefined;
6+
groups: readonly Group[] | undefined;
87
};
98

10-
export function GroupsCell({ user, groupsByUserId }: GroupsCellProps) {
11-
return <TableCell>5 Groups</TableCell>;
9+
export function GroupsCell({ groups }: GroupsCellProps) {
10+
return (
11+
<TableCell>
12+
{groups === undefined ? (
13+
<em>N/A</em>
14+
) : (
15+
<Stack>
16+
<div>
17+
{groups.length} Group{groups.length !== 1 && "s"}
18+
</div>
19+
</Stack>
20+
)}
21+
</TableCell>
22+
);
1223
}

site/src/pages/UsersPage/UsersTable/UsersTableBody.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -157,7 +157,7 @@ export const UsersTableBody: FC<
157157
onUserRolesUpdate={onUpdateUserRoles}
158158
/>
159159

160-
<GroupsCell groupsByUserId={groupsByUserId} user={user} />
160+
<GroupsCell groups={groupsByUserId?.get(user.id)} />
161161

162162
<TableCell>
163163
<LoginType authMethods={authMethods!} value={user.login_type} />

0 commit comments

Comments
 (0)