Dan Albert 6ff9208d46 Reorganize React project structure.
Whatever I was doing was getting out of control :)
2022-03-01 01:14:21 -08:00

21 lines
608 B
TypeScript

import FlightPlan from "../flightplan";
import { LayerGroup } from "react-leaflet";
import { selectFlights } from "../../api/flightsSlice";
import { useAppSelector } from "../../app/hooks";
interface FlightPlansLayerProps {
blue: boolean;
}
export default function FlightPlansLayer(props: FlightPlansLayerProps) {
const atos = useAppSelector(selectFlights);
const flights = props.blue ? atos.blue : atos.red;
return (
<LayerGroup>
{Object.values(flights).map((flight) => {
return <FlightPlan key={flight.id} flight={flight} selected={false} />;
})}
</LayerGroup>
);
}