aboutsummaryrefslogtreecommitdiff
path: root/src/components/StopItem.tsx
blob: cf9ccfc08ab7f37df98a489d85e2fb9ab0aa628d (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
import React from 'react';
import { Link } from 'react-router';
import StopDataProvider, { Stop } from '../data/StopDataProvider';
import LineIcon from './LineIcon';

interface StopItemProps {
  stop: Stop;
}

const StopItem: React.FC<StopItemProps> = ({ stop }) => {

  return (
    <li className="list-item">
      <Link className="list-item-link" to={`/estimates/${stop.stopId}`}>
      {stop.favourite && <span className="favourite-icon"></span>} ({stop.stopId}) {StopDataProvider.getDisplayName(stop)}
        <div className="line-icons">
          {stop.lines?.map(line => <LineIcon key={line} line={line} />)}
        </div>
        
      </Link>
    </li>
  );
};

export default StopItem;