import{aM as c,r as l,aJ as r}from"./@ui-core-DKdciH1Z.js";import{B as u,F as f,W as x}from"./Wizard-CpBM0aaK.js";import{az as h,e as j,B as s,r as a}from"./index-D7KLAbvI.js";import{c as C,a as i,L as b}from"./@react-router-DaIuhn3X.js";import{C as v}from"./configuration-form-DQMoUCqK.js";import"./@reactflow-CJzATMj6.js";import"./@zod-DKyD3xVW.js";import"./@monaco-editor-CSMpaClf.js";import"./index-DPr7bdjs.js";import"./form-DKk08jkZ.js";import"./transform-Bq7p9csj.js";import"./check-tR7EFZ1z.js";import"./CodeSnippet-Dwuwo3ZI.js";import"./file-text-BLW8J__B.js";import"./ComponentIcon-BOKrWHiD.js";import"./bar-chart-square-check-Lt3fLSJ-.js";import"./layout-BRN9AeDt.js";function g(){const t=C(),{componentId:o}=i(),e=c({...h.componentDetail(o),throwOnError:!0});function m(p){t(a.components.detail(p))}const d=l.useId();if(e.isPending)return r.jsx(j,{className:"h-[300px] w-full"});if(e.isError)return r.jsx("div",{children:"Error"});const n=e.data.resources?.flavor?.id;return n?r.jsx(r.Fragment,{children:r.jsx(u,{className:"p-0",children:r.jsx(v,{component:e.data,flavorId:n,formId:d,isCreate:!1,successHandler:m,FooterComponent:E})})}):r.jsx("div",{children:"No flavor found"})}function E({formId:t,isPending:o}){const e=i();return r.jsxs(f,{children:[r.jsx(s,{asChild:!0,intent:"secondary",size:"md",children:r.jsx(b,{to:a.components.detail(e.componentId),children:"Cancel"})}),r.jsxs(s,{size:"md",disabled:o,type:"submit",form:t,children:[o&&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 O(){return r.jsx("section",{className:"layout-container mt-5 pb-5",children:r.jsx(x,{children:r.jsx(g,{})})})}export{O as default};
