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 authored and firestack committed Sep 19, 2024
1 parent 174f8ea commit cee7900
Showing 1 changed file with 5 additions and 14 deletions.
19 changes: 5 additions & 14 deletions assets/src/components/detoursTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,24 +41,15 @@ export const DetoursTable = ({ data, status }: DetoursTableProps) => (
</tr>
</thead>
<tbody>
<DetourRows data={data} status={status} />
{data === null ? (
<EmptyDetourRows message={`No ${status} detours.`} />
) : (
<PopulatedDetourRows data={data} />
)}
</tbody>
</Table>
)

const DetourRows = ({
data,
status,
}: {
data: SimpleDetour[] | null
status: DetourStatus
}) =>
data === null ? (
<EmptyDetourRows message={`No ${status} detours.`} />
) : (
<PopulatedDetourRows data={data} />
)

const PopulatedDetourRows = ({ data }: { data: SimpleDetour[] }) => {
const epochNowInSeconds = useCurrentTimeSeconds()

Expand Down

0 comments on commit cee7900

Please sign in to comment.