import { useViewSceneStore } from "../../../../store/builder/store";
import { useSceneContext } from "../../../scene/sceneContext";
import RoboticArmInstance from "./armInstance/roboticArmInstance";
import RoboticArmContentUi from "../../ui3d/RoboticArmContentUi";
import React from "react";

function RoboticArmInstances() {
    const { armBotStore } = useSceneContext();
    const { armBots } = armBotStore();
    const { viewSceneLabels } = useViewSceneStore();

    return (
        <>
            {armBots?.map((robot: ArmBotStatus) => (
                <React.Fragment key={robot.modelUuid}>
                    <RoboticArmInstance armBot={robot} />
                    {viewSceneLabels && <RoboticArmContentUi roboticArm={robot} />}
                </React.Fragment>
            ))}
        </>
    );
}

export default RoboticArmInstances;
