import React from "react";
import VehicleInstance from "./instance/vehicleInstance";
import VehicleContentUi from "../../ui3d/VehicleContentUi";
import { useSceneContext } from "../../../scene/sceneContext";

function VehicleInstances() {
    const { vehicleStore } = useSceneContext();
    const { vehicles } = vehicleStore();

    return (
        <>
            {vehicles.map((vehicle: VehicleStatus) => (
                <React.Fragment key={vehicle.modelUuid}>
                    <VehicleInstance agvDetail={vehicle} />
                    <VehicleContentUi vehicle={vehicle} />
                </React.Fragment>
            ))}
        </>
    );
}

export default VehicleInstances;
