Skip to content

Commit

Permalink
refactor: slightly cleanup code and update todo
Browse files Browse the repository at this point in the history
  • Loading branch information
Gobot1234 committed May 12, 2024
1 parent c0a5aab commit 8dc302c
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions apps/forge/src/routes/_authenticated/_reponly/users/$id.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
import { UserAvatar } from "@/components/avatar";
import { LocationIcon } from "@/components/icons/Locations";
import SignInsChart from "@/routes/_authenticated/_reponly/signin/dashboard/-components/SignInsChart.tsx";
import Title from "@/components/title";
import { extractError } from "@/lib/utils";
import SignInsChart from "@/routes/_authenticated/_reponly/signin/dashboard/-components/SignInsChart.tsx";
import { getUser } from "@/services/users/getUser.ts";
import getUserSignIns from "@/services/users/getUserSignIns.ts";
import { getUserTraining } from "@/services/users/getUserTraining.ts";
Expand Down Expand Up @@ -102,7 +102,7 @@ export default function Component() {
<TableHead>Name</TableHead>
<TableHead className="text-center">Location</TableHead>
<TableHead className="text-center">Compulsory</TableHead>
{rep ? <TableHead className="text-center">Rep Training</TableHead> : undefined}
{rep && <TableHead className="text-center">Rep Training</TableHead>}
<TableHead className="text-center">Completed On</TableHead>
<TableHead className="text-center">Completed In Person On</TableHead>
<TableHead className="text-center">Renewal Due</TableHead>
Expand All @@ -113,7 +113,7 @@ export default function Component() {
.sort((a, b) => a.name.localeCompare(b.name))
.map((training) =>
training["@created_at"] ? (
<TableRow>
<TableRow key={training.id}>
<TableCell>
<div className="text-sm">{training.name}</div>
</TableCell>
Expand All @@ -125,13 +125,13 @@ export default function Component() {
{training.compulsory ? <Check stroke="green" /> : <X stroke="red" />}
</div>
</TableCell>
{rep ? ( // FIXME this is mostly broken
{rep && ( // TODO if user training is a pre-req to rep training we can collapse the 2 into one entry.
<TableCell>
<div className="flex justify-center">
{training.rep ? <Check stroke="green" /> : <X stroke="red" />}
</div>
</TableCell>
) : undefined}
)}
<TableCell>
<div className="text-sm text-center">
{new Date(training["@created_at"]).toLocaleDateString()}
Expand Down

0 comments on commit 8dc302c

Please sign in to comment.