-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathUsers.tsx
47 lines (43 loc) · 1.27 KB
/
Users.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
import Button from 'react-bootstrap/Button'
import Table from 'react-bootstrap/Table'
import type { FindUsersByOrganizationId } from 'types/graphql'
import { Link, routes } from '@redwoodjs/router'
import { timeTag, truncate, formatEnum } from 'src/lib/formatters'
const UsersList = ({ usersByOrganization }: FindUsersByOrganizationId) => {
return (
<Table striped bordered>
<thead>
<tr>
<th>Email</th>
<th>Name</th>
<th>Role</th>
<th>Agency</th>
<th>Created at</th>
<th>Actions</th>
</tr>
</thead>
<tbody>
{usersByOrganization.map((user) => (
<tr key={user.id}>
<td>{truncate(user.email)}</td>
<td>{truncate(user.name)}</td>
<td>{formatEnum(user.role)}</td>
<td>{truncate(user.agency?.name)}</td>
<td>{timeTag(user.createdAt)}</td>
<td>
<Link
to={routes.editUser({ id: user.id })}
title={'Edit user ' + user.id}
>
<Button size="sm" variant="secondary">
Edit
</Button>
</Link>
</td>
</tr>
))}
</tbody>
</Table>
)
}
export default UsersList