Skip to content

Commit

Permalink
Better display trained users
Browse files Browse the repository at this point in the history
  • Loading branch information
Lan2u committed Oct 2, 2024
1 parent e01f87b commit cb509ff
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/queries/equipment/render.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,20 +112,22 @@ const equipmentActions = (viewModel: ViewModel) => html`
const currentlyTrainedUsersTable = (viewModel: ViewModel) =>
pipe(
viewModel.equipment.trainedMembers,
RA.map(member => member.memberNumber),
RA.map(renderMemberNumber),
RA.map(
memberNumberHtml =>
member =>
html`<tr>
<td>${memberNumberHtml}</td>
<td>${sanitizeString(O.getOrElse(() => '')(member.name))}</td>
<td>${renderMemberNumber(member.memberNumber)}</td>
<td>${displayDate(DateTime.fromJSDate(member.trainedAt))}</td>
</tr>`
),
joinHtml,
rows => html`
<h2>Currently Trained Users</h2>
<table>
<tr>
<th>Name</th>
<th>Member Number</th>
<th>Trained at</th>
</tr>
${rows}
</table>
Expand Down

0 comments on commit cb509ff

Please sign in to comment.