import type { FC } from "react";
import type { IFlightLeg } from "../../types.js";
import { Timeline } from "./Timeline.js";
import "./FullRouteTimeline.scss";

export interface FullRouteTimelineProps {
  legs: IFlightLeg[];
  viewType: "Onlineboard" | "Schedule";
}

export const FullRouteTimeline: FC<FullRouteTimelineProps> = ({ legs, viewType }) => {
  if (legs.length < 2) return null;
  return (
    <section className="full-route-timeline" data-testid="full-route-timeline">
      <Timeline legs={legs} canChange={viewType === "Onlineboard"} />
    </section>
  );
};
