Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 | 8x 6x 8x | import React from "react";
import ReloadButton from "../../../component/buttons/ReloadButton";
import "../../nearby/components/NearbyViewComponent.scss";
interface Props {
refresh: () => void;
nextRefreshAt: number | null;
now: number;
loading: boolean;
showArrivals: boolean;
}
export default function ReloadIntervalCoordinator({
refresh,
nextRefreshAt,
now,
loading,
showArrivals,
}: Props) {
if (!showArrivals) return null;
const seconds =
nextRefreshAt === null
? 30
: Math.max(0, Math.ceil((nextRefreshAt - now) / 1000));
return (
<div className="stops-reload-button">
<ReloadButton disabled={loading} onClick={refresh}>
<span className="count-down-label">{seconds}</span>
</ReloadButton>
</div>
);
}
|