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>
        </>
    );
}
