mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Partial implementation of TGO display.
No threat/detection circles yet. https://github.com/dcs-liberation/dcs_liberation/issues/2039
This commit is contained in:
22
client/src/components/tgoslayer/TgosLayer.tsx
Normal file
22
client/src/components/tgoslayer/TgosLayer.tsx
Normal file
@@ -0,0 +1,22 @@
|
||||
import { LayerGroup } from "react-leaflet";
|
||||
import Tgo from "../tgos/Tgo";
|
||||
import { TgoType } from "../../api/tgo";
|
||||
import { selectTgos } from "../../api/tgosSlice";
|
||||
import { useAppSelector } from "../../app/hooks";
|
||||
|
||||
interface TgosLayerProps {
|
||||
type: TgoType;
|
||||
}
|
||||
|
||||
export default function TgosLayer(props: TgosLayerProps) {
|
||||
const allTgos = useAppSelector(selectTgos);
|
||||
const tgos = allTgos.tgosByType[props.type];
|
||||
console.dir(Object.entries(TgoType));
|
||||
return (
|
||||
<LayerGroup>
|
||||
{tgos.map((tgo) => {
|
||||
return <Tgo key={tgo.name} tgo={tgo} />;
|
||||
})}
|
||||
</LayerGroup>
|
||||
);
|
||||
}
|
||||
1
client/src/components/tgoslayer/index.ts
Normal file
1
client/src/components/tgoslayer/index.ts
Normal file
@@ -0,0 +1 @@
|
||||
export { default } from "./TgosLayer";
|
||||
Reference in New Issue
Block a user