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 9, 2024
1 parent 0410d28 commit 67b3662
Showing 1 changed file with 14 additions and 16 deletions.
30 changes: 14 additions & 16 deletions assets/src/components/detoursTable.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,22 +9,20 @@ interface DetoursTableProps {
data: Detour[] | null
}

export const DetoursTable = ({ data }: DetoursTableProps) => {
return (
<Table hover className="c-detours-table">
<thead className="u-hide-for-mobile">
<tr>
<th className="px-3 py-4">Route and direction</th>
<th className="px-3 py-4 u-hide-for-mobile">Starting Intersection</th>
<th className="px-3 py-4 u-hide-for-mobile">On detour since</th>
</tr>
</thead>
<tbody>
<DetourRows data={data} />
</tbody>
</Table>
)
}
export const DetoursTable = ({ data }: DetoursTableProps) => (
<Table hover={data !== null} className="c-detours-table">
<thead className="u-hide-for-mobile">
<tr>
<th className="px-3 py-4">Route and direction</th>
<th className="px-3 py-4 u-hide-for-mobile">Starting Intersection</th>
<th className="px-3 py-4 u-hide-for-mobile">On detour since</th>
</tr>
</thead>
<tbody>
<DetourRows data={data} />
</tbody>
</Table>
)

const DetourRows = ({ data }: { data: Detour[] | null }) =>
data === null ? (
Expand Down

0 comments on commit 67b3662

Please sign in to comment.