Skip to content

Commit

Permalink
display ? for tax errors
Browse files Browse the repository at this point in the history
  • Loading branch information
mciparelli committed Sep 19, 2023
1 parent 59569f3 commit a862ba4
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion components/flight.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { formatFlightDateLong, formatFlightDateShort } from "utils/dates.js";
import Spinner from "components/spinner.jsx";

export default function Flight({ flight, canje, bgColor }) {
const { data: taxInfo, isLoading } = useSWR(
const { data: taxInfo, error: taxError, isLoading } = useSWR(
{ flightUid: flight.uid, fare: flight.fare },
getTax,
);
Expand Down Expand Up @@ -56,6 +56,7 @@ export default function Flight({ flight, canje, bgColor }) {
<td class={`${bgColor} px-2`}>
{isLoading && <Spinner />}
{taxInfo && `$${Math.floor(taxInfo.money / 1000)}K`}
{taxError && '?'}
</td>
</tr>
);
Expand Down

0 comments on commit a862ba4

Please sign in to comment.