add flatastic api
This commit is contained in:
23
src/components/TimetableRow/TimetableRow.tsx
Normal file
23
src/components/TimetableRow/TimetableRow.tsx
Normal file
@@ -0,0 +1,23 @@
|
||||
import { type DepartureList } from "../../types/types";
|
||||
|
||||
import styles from "./style.module.css";
|
||||
|
||||
export default function TimetableRow({
|
||||
departure,
|
||||
}: {
|
||||
departure: DepartureList;
|
||||
}) {
|
||||
const hour = String(departure.dateTime.hour).padStart(2, "0");
|
||||
const minute = String(departure.dateTime.minute).padStart(2, "0");
|
||||
const dateTimeString = `${hour}:${minute}`;
|
||||
return (
|
||||
<>
|
||||
<tr className={styles.timetableRow}>
|
||||
<td>{dateTimeString}</td>
|
||||
<td>{departure.servingLine.name}</td>
|
||||
<td>{departure.servingLine.number}</td>
|
||||
<td>({departure.servingLine.direction})</td>
|
||||
</tr>
|
||||
</>
|
||||
);
|
||||
}
|
||||
3
src/components/TimetableRow/style.module.css
Normal file
3
src/components/TimetableRow/style.module.css
Normal file
@@ -0,0 +1,3 @@
|
||||
.timetableRow {
|
||||
text-align: left;
|
||||
}
|
||||
Reference in New Issue
Block a user