Skip to content

Commit

Permalink
fixup! feat: Display empty detour table icon when the table is empty
Browse files Browse the repository at this point in the history
  • Loading branch information
joshlarson committed Sep 23, 2024
1 parent e015206 commit 51cde35
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions assets/src/components/detoursTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { SimpleDetour } from "../models/detoursList"
import { EmptyDetourTableIcon } from "../helpers/skateIcons"

interface DetoursTableProps {
data: SimpleDetour[] | null
data: SimpleDetour[] | undefined
status: DetourStatus
}

Expand All @@ -31,7 +31,7 @@ export const timestampLabelFromStatus = (status: DetourStatus) => {
}

export const DetoursTable = ({ data, status }: DetoursTableProps) => (
<Table hover={data !== null} className="c-detours-table">
<Table hover={!!data} className="c-detours-table">
<thead className="u-hide-for-mobile">
<tr>
<th className="px-3 py-4">Route and direction</th>
Expand All @@ -42,10 +42,10 @@ export const DetoursTable = ({ data, status }: DetoursTableProps) => (
</tr>
</thead>
<tbody>
{data === null ? (
<EmptyDetourRows message={`No ${status} detours.`} />
) : (
{data ? (
<PopulatedDetourRows data={data} />
) : (
<EmptyDetourRows message={`No ${status} detours.`} />
)}
</tbody>
</Table>
Expand Down

0 comments on commit 51cde35

Please sign in to comment.