import{j as r}from"./@radix-D8tIKeo-.js";import{B as c,F as l,W as u}from"./Wizard-DwwmIuX2.js";import{aV as f,e as x,B as s,r as i}from"./index-B44sgOyQ.js";import{a as h}from"./@monaco-editor-CuNQBT0l.js";import{c as j,a,L as C}from"./@react-router-D1ODL_Ub.js";import{b}from"./@tanstack-nMqraTcu.js";import{C as v}from"./configuration-form-CdSYJ0kk.js";import"./@elkjs-CmhuJAjY.js";import"./@reactflow-DgowYF6H.js";import"./@zod-2qqdh1cM.js";import"./index-Hfv1xSzc.js";import"./form-BihvUgsp.js";import"./plus-BjxzjZ9E.js";import"./trash-Dp8wQrEE.js";import"./transform-DsIiQtL0.js";import"./check-Dbdrcavu.js";import"./CodeSnippet-WWMTzt1F.js";import"./file-text-B8km-r-t.js";import"./ComponentIcon-Btqtj6Xx.js";import"./bar-chart-square-check-BAWR96En.js";import"./layout-BBB8hotd.js";function g(){const e=j(),{componentId:t}=a(),o=b({...f.componentDetail(t),throwOnError:!0});function m(d){e(i.components.detail(d))}const p=h.useId();if(o.isPending)return r.jsx(x,{className:"h-[300px] w-full"});if(o.isError)return r.jsx("div",{children:"Error"});const n=o.data.resources?.flavor?.id;return n?r.jsx(r.Fragment,{children:r.jsx(c,{className:"p-0",children:r.jsx(v,{component:o.data,flavorId:n,formId:p,isCreate:!1,successHandler:m,FooterComponent:E})})}):r.jsx("div",{children:"No flavor found"})}function E({formId:e,isPending:t}){const o=a();return r.jsxs(l,{children:[r.jsx(s,{asChild:!0,intent:"secondary",size:"md",children:r.jsx(C,{to:i.components.detail(o.componentId),children:"Cancel"})}),r.jsxs(s,{size:"md",disabled:t,type:"submit",form:e,children:[t&&r.jsx("div",{role:"alert","aria-busy":"true",className:"full h-[20px] w-[20px] animate-spin rounded-rounded border-2 border-theme-text-negative border-b-theme-text-brand"}),"Update Component"]})]})}function G(){return r.jsx("section",{className:"layout-container mt-5 pb-5",children:r.jsx(u,{children:r.jsx(g,{})})})}export{G as default};
