display/src/Tcl.tsx

39 lines
1.2 KiB
TypeScript
Raw Normal View History

2021-11-12 16:41:27 +01:00
import React from "react";
2021-11-12 17:24:16 +01:00
import {FontAwesomeIcon} from '@fortawesome/react-fontawesome'
2021-11-14 12:26:42 +01:00
import {faBus, faDirections} from '@fortawesome/free-solid-svg-icons'
import {faClock} from '@fortawesome/free-regular-svg-icons'
import {Card, Col, ListGroup} from "react-bootstrap";
2021-11-12 17:24:16 +01:00
2021-11-13 15:53:10 +01:00
export type PassageType = string | undefined;
2021-11-12 16:41:27 +01:00
2021-11-14 12:26:42 +01:00
export interface IStop {
id: number;
name: string;
}
2021-11-13 15:53:10 +01:00
export interface ILigne {
2021-11-14 12:26:42 +01:00
ligne: string;
2021-11-13 15:53:10 +01:00
delais: PassageType[];
2021-11-14 12:26:42 +01:00
destination: IStop;
2021-11-13 15:53:10 +01:00
}
export default class Tcl extends React.Component<ILigne> {
2021-11-12 16:41:27 +01:00
render() {
return <Col>
<Card>
<Card.Header>
2021-11-14 12:26:42 +01:00
<FontAwesomeIcon icon={faBus}/> {this.props.ligne}
</Card.Header>
2021-11-14 12:26:42 +01:00
<ListGroup variant="flush">
<ListGroup.Item>
<FontAwesomeIcon icon={faDirections}/> {this.props.destination.name}
</ListGroup.Item>
{this.props.delais.map((passage, index) => <ListGroup.Item key={index}>
<FontAwesomeIcon icon={faClock}/> {passage}
</ListGroup.Item>)}
</ListGroup>
</Card>
</Col>
2021-11-12 16:41:27 +01:00
}
}