mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Reorganize React project structure.
Whatever I was doing was getting out of control :)
This commit is contained in:
20
client/src/components/flightplanslayer/FlightPlansLayer.tsx
Normal file
20
client/src/components/flightplanslayer/FlightPlansLayer.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
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>
|
||||
);
|
||||
}
|
||||
1
client/src/components/flightplanslayer/index.ts
Normal file
1
client/src/components/flightplanslayer/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { default } from "./FlightPlansLayer";
|
||||
Reference in New Issue
Block a user