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 34 35 36 37 38 39 40 41 42 43 44 | import { Card, CardBody, CardHeader } from "@wintermuted/ui-react";
import { isEmpty, map } from "lodash";
import React from "react";
import { StopLocation } from "../../../api/trimet/interfaces/types";
import StopContainer from "../../nearbyStops/containers/StopContainer";
interface Props {
bookmarks: StopLocation[];
}
function getBookmarks(bookmarks: StopLocation[]) {
return map(bookmarks, (stopLocation: StopLocation) => {
const locationId = stopLocation.locid
? stopLocation.locid
: stopLocation.id;
return (
<div key={locationId} className="bookmark-stop-wrapper">
<StopContainer locationId={locationId} showArrivals={false} />
</div>
);
});
}
function BookmarkedStops({ bookmarks }: Props) {
if (isEmpty(bookmarks)) {
return (
<Card>
<CardHeader>Uncategorized Bookmarks</CardHeader>
<CardBody>Bookmark a stop and see it here.</CardBody>
</Card>
);
}
return (
<div>
<h2 style={{ fontSize: "1.5rem" }}>Stops</h2>
{getBookmarks(bookmarks)}
</div>
);
}
export default BookmarkedStops;
|