import{j as r}from"./@radix-DAoBbclx.js";import{B as u,F as f,W as x}from"./Wizard-hAO-IC7P.js";import{aV as h,e as j,B as a,r as m}from"./index-DnCFURX3.js";import{a as C}from"./@monaco-editor-Di1Jq_O0.js";import{c as b,a as p,L as v}from"./@react-router-BTai9D5g.js";import{b as g}from"./@tanstack-2852wz5w.js";import{C as E}from"./configuration-form-DXxy_aRi.js";import"./@elkjs-CmhuJAjY.js";import"./@reactflow-CLotj7HR.js";import"./@zod-3snSrKBm.js";import"./index-DOATnzYZ.js";import"./form-Cwep_u6P.js";import"./plus-E8wmxLMS.js";import"./trash-DsZfFPdX.js";import"./transform-CoT5Lusb.js";import"./check-xnjpt4bv.js";import"./CodeSnippet-j6SUjNoa.js";import"./file-text-_omkpCSq.js";import"./ComponentIcon-BOGF3ktm.js";import"./bar-chart-square-check-CVLivjI6.js";import"./layout-BtXy9gkl.js";function y(){var s,i;const e=b(),{componentId:t}=p(),o=g({...h.componentDetail(t),throwOnError:!0});function d(l){e(m.components.detail(l))}const c=C.useId();if(o.isPending)return r.jsx(j,{className:"h-[300px] w-full"});if(o.isError)return r.jsx("div",{children:"Error"});const n=(i=(s=o.data.resources)==null?void 0:s.flavor)==null?void 0:i.id;return n?r.jsx(r.Fragment,{children:r.jsx(u,{className:"p-0",children:r.jsx(E,{component:o.data,flavorId:n,formId:c,isCreate:!1,successHandler:d,FooterComponent:N})})}):r.jsx("div",{children:"No flavor found"})}function N({formId:e,isPending:t}){const o=p();return r.jsxs(f,{children:[r.jsx(a,{asChild:!0,intent:"secondary",size:"md",children:r.jsx(v,{to:m.components.detail(o.componentId),children:"Cancel"})}),r.jsxs(a,{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 K(){return r.jsx("section",{className:"layout-container mt-5 pb-5",children:r.jsx(x,{children:r.jsx(y,{})})})}export{K as default};
