urbi-exhibitions
Version:
2 lines (1 loc) • 687 B
JavaScript
;Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react"),d=require("../toChunks-BmGk2hQ8.cjs"),u=require("../mapContext-BXdviyXK.cjs"),r=(o,t)=>l.useMemo(()=>!o||!t?[]:d.toChunks(o,t),[o,t]),f=o=>{const{models:t}=o,{map:e}=u.useMap();l.useEffect(()=>{if(e)return e.state.floorLevelIndex===0&&t.forEach(s=>{e.gltfPlugin.getModelStatus(s.modelId)===0?e.gltfPlugin.addModel(s).catch(n=>{console.log("Failed to load stand models: ",n)}):e.gltfPlugin.showModel(s.modelId)}),()=>{e.gltfPlugin.hideModels(t.map(s=>s.modelId))}},[e==null?void 0:e.gltfPlugin,e==null?void 0:e.state.floorLevelIndex,t])};exports.useChunks=r;exports.useGltfModels=f;