import React from "react";
import VehicleInstance from "./instance/vehicleInstance";
import { useVehicleStore } from "../../../../store/simulation/useVehicleStore";
import VehicleContentUi from "../../ui3d/VehicleContentUi";

function VehicleInstances() {
  const { vehicles } = useVehicleStore();

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

export default VehicleInstances;
