-
Notifications
You must be signed in to change notification settings - Fork 5
/
Agencies.tsx
43 lines (39 loc) · 1.26 KB
/
Agencies.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
import Button from 'react-bootstrap/Button'
import Table from 'react-bootstrap/Table'
import type { FindAgencies } from 'types/graphql'
import { Link, routes } from '@redwoodjs/router'
import { truncate } from 'src/lib/formatters'
const AgenciesList = ({ agencies }: FindAgencies) => {
return (
<Table striped borderless>
<thead>
<tr>
<th className="border">Agency Code</th>
<th className="border">Name</th>
<th className="border">Actions</th>
</tr>
</thead>
<tbody>
{agencies.map((agency) => (
<tr key={agency.id}>
<td className="border border-slate-700">{truncate(agency.code)}</td>
<td className="border border-slate-700">{truncate(agency.name)}</td>
<td className="border border-slate-700">
<nav className="rw-table-actions">
<Link
to={routes.editAgency({ id: agency.id })}
title={'Edit agency ' + agency.id}
>
<Button size="sm" variant="secondary">
Edit
</Button>
</Link>
</nav>
</td>
</tr>
))}
</tbody>
</Table>
)
}
export default AgenciesList