import{i as c}from"./emotion-use-insertion-effect-with-fallbacks.browser.esm-6809063d.js";import{a as e,F as o,j as p}from"./Tooltip-ae8d7992.js";import{u as C,D as j,C as v}from"./GenericForm-d90662c8.js";import{g as x,u as J}from"./index-dfa17bed.js";const{Suspense:n,useEffect:t,useState:i}=await c("react"),{Box:D}=await c("@mui/material"),E=()=>{let{name:a}=x();const{loading:S,data:r,error:l,load:d}=C(a||"",!0),[m,u]=i(!1),[f,s]=i(!0);J();const h=async()=>{d()};if(t(()=>{r&&u(!0),s(!1)},[r]),t(()=>{s(!0),a&&h()},[a]),!l)if(f){const g=`Error: No se encontro el componente components/Custom/${a}`;return p(D,{height:"100dvh",children:[e("h3",{children:a}),e("div",{className:"error",children:g})]})}else return m?e(o,{children:e(n,{fallback:e("div",{children:"Cargando..."}),children:e(v,{})})}):e(o,{children:e(n,{fallback:e("div",{children:"Cargando..."}),children:e(j,{})})})};export{E as default};
