2025-06-05 10:08:16 +00:00
|
|
|
import { useEffect } from 'react'
|
2025-05-27 12:41:26 +00:00
|
|
|
import AisleCreator from './aisleCreator/aisleCreator'
|
|
|
|
import AisleInstances from './Instances/aisleInstances'
|
2025-06-05 10:08:16 +00:00
|
|
|
import { useParams } from 'react-router-dom';
|
|
|
|
import { getAisleApi } from '../../../services/factoryBuilder/aisle/getAisleApi';
|
|
|
|
import { useAisleStore } from '../../../store/builder/useAisleStore';
|
2025-05-27 12:41:26 +00:00
|
|
|
|
|
|
|
function AislesGroup() {
|
2025-06-05 10:08:16 +00:00
|
|
|
const { projectId } = useParams();
|
|
|
|
const { setAisles } = useAisleStore();
|
2025-06-19 12:38:26 +00:00
|
|
|
|
2025-06-05 10:08:16 +00:00
|
|
|
useEffect(() => {
|
2025-06-19 12:38:26 +00:00
|
|
|
if (projectId) {
|
|
|
|
getAisleApi(projectId).then((aisles) => {
|
2025-06-05 10:08:16 +00:00
|
|
|
setAisles(aisles);
|
2025-06-19 12:38:26 +00:00
|
|
|
}).catch((err) => {
|
|
|
|
console.log(err);
|
|
|
|
})
|
2025-06-05 10:08:16 +00:00
|
|
|
}
|
2025-06-19 12:38:26 +00:00
|
|
|
}, [projectId])
|
2025-05-27 12:41:26 +00:00
|
|
|
|
|
|
|
return (
|
|
|
|
|
|
|
|
<>
|
|
|
|
|
|
|
|
<AisleCreator />
|
|
|
|
|
2025-06-05 10:08:16 +00:00
|
|
|
|
2025-05-27 12:41:26 +00:00
|
|
|
<AisleInstances />
|
|
|
|
|
|
|
|
</>
|
|
|
|
|
|
|
|
)
|
|
|
|
}
|
|
|
|
|
|
|
|
export default AislesGroup
|