Add websocket handling for selected flights.

This commit is contained in:
Dan Albert
2022-03-01 20:42:59 -08:00
parent 6d29bfdf65
commit 8e8bbe84f3
13 changed files with 190 additions and 13 deletions

View File

@@ -3,14 +3,25 @@ import { Polyline } from "react-leaflet";
const BLUE_PATH = "#0084ff";
const RED_PATH = "#c85050";
const SELECTED_PATH = "#ffff00";
interface FlightPlanProps {
flight: Flight;
selected: boolean;
}
const pathColor = (props: FlightPlanProps) => {
if (props.selected) {
return SELECTED_PATH;
} else if (props.flight.blue) {
return BLUE_PATH;
} else {
return RED_PATH;
}
};
function FlightPlanPath(props: FlightPlanProps) {
const color = props.flight.blue ? BLUE_PATH : RED_PATH;
const color = pathColor(props);
const waypoints = props.flight.waypoints;
if (waypoints == null) {
return <></>;