blob: 72a13e540f720ccf3eda279d778f6f2907704283 (
plain)
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
|
import React from "react";
import { Link } from "react-router";
import StopDataProvider, { type Stop } from "../data/StopDataProvider";
import LineIcon from "./LineIcon";
interface StopGalleryItemProps {
stop: Stop;
}
const StopGalleryItem: React.FC<StopGalleryItemProps> = ({ stop }) => {
return (
<div className="gallery-item">
<Link className="gallery-item-link" to={`/stops/${stop.stopId}`}>
<div className="gallery-item-header">
{stop.favourite && <span className="favourite-icon">★</span>}
<span className="gallery-item-code">({stop.stopId})</span>
</div>
<div className="gallery-item-name">
{StopDataProvider.getDisplayName(stop)}
</div>
<div className="gallery-item-lines">
{stop.lines?.slice(0, 5).map((line) => (
<LineIcon key={line} line={line} />
))}
{stop.lines && stop.lines.length > 5 && (
<span className="more-lines">+{stop.lines.length - 5}</span>
)}
</div>
</Link>
</div>
);
};
export default StopGalleryItem;
|