import React from "react";
import MachineInstance from "./machineInstance/machineInstance";
import MachineContentUi from "../../ui3d/MachineContentUi";
import { useSceneContext } from "../../../scene/sceneContext";

function MachineInstances() {
    const { machineStore } = useSceneContext();
    const { machines } = machineStore();
    return (
        <>
            {machines.map((machine: MachineStatus) => (
                <React.Fragment key={machine.modelUuid}>
                    <MachineInstance machineDetail={machine} />
                    <MachineContentUi machine={machine} />
                </React.Fragment>
            ))}
        </>
    );
}

export default MachineInstances;
