feat: Refactor simulation components and enhance product management with new features
This commit is contained in:
20
app/src/modules/simulation/products/products.tsx
Normal file
20
app/src/modules/simulation/products/products.tsx
Normal file
@@ -0,0 +1,20 @@
|
||||
import React, { useEffect } from 'react'
|
||||
import { useProductStore } from '../../../store/simulation/useProductStore'
|
||||
import * as THREE from 'three';
|
||||
|
||||
function Products() {
|
||||
const { products, addProduct } = useProductStore();
|
||||
|
||||
useEffect(() => {
|
||||
if (products.length === 0) {
|
||||
addProduct('Product 1', THREE.MathUtils.generateUUID());
|
||||
}
|
||||
}, [products])
|
||||
|
||||
return (
|
||||
<>
|
||||
</>
|
||||
)
|
||||
}
|
||||
|
||||
export default Products
|
||||
@@ -9,6 +9,7 @@ import Materials from './materials/materials';
|
||||
import Machine from './machine/machine';
|
||||
import StorageUnit from './storageUnit/storageUnit';
|
||||
import Simulator from './simulator/simulator';
|
||||
import Products from './products/products';
|
||||
|
||||
function Simulation() {
|
||||
const { events } = useEventsStore();
|
||||
@@ -27,6 +28,8 @@ function Simulation() {
|
||||
|
||||
<Points />
|
||||
|
||||
<Products />
|
||||
|
||||
<Materials />
|
||||
|
||||
<Conveyor />
|
||||
|
||||
Reference in New Issue
Block a user