import React from 'react'
import VehicleInstance from './instance/vehicleInstance'
import { useVehicleStore } from '../../../../store/simulation/useVehicleStore'
import VehicleUI from '../../ui/vehicle/vehicleUI';
type VehicleUIProps = {
    vehicleStatusSample: VehicleEventSchema[];
    setVehicleStatusSample: React.Dispatch<
        React.SetStateAction<VehicleEventSchema[]>
    >;
};
const VehicleInstances: React.FC<VehicleUIProps> = ({
    vehicleStatusSample,
    setVehicleStatusSample,
}) => {

    const { vehicles } = useVehicleStore();

    return (
        <>

            {vehicles.map((val: any, i: any) =>
                <>
                    <VehicleInstance agvDetail={val} key={i} />
                    <VehicleUI
                        setVehicleStatusSample={setVehicleStatusSample}
                        vehicleStatusSample={vehicleStatusSample}
                        vehicle={val}
                    />
                </>
            )}

        </>
    )
}

export default VehicleInstances