import{r as u,j as r}from"./@radix-3bj3otF9.js";import{B as f,F as x,W as h}from"./Wizard-4VggIqxW.js";import{aY as j,e as C,B as a,r as m}from"./index-Cs2FY84s.js";import{c as b,a as p,L as v}from"./@react-router-Ct_TgVUW.js";import{b as g}from"./@tanstack-CByuvRcg.js";import{C as E}from"./configuration-form-D548raEC.js";import"./@reactflow-CwWcBchH.js";import"./index-CBSLKE7I.js";import"./form-VGcfkVJw.js";import"./plus-Cewn_igr.js";import"./trash-B0fyghWi.js";import"./index.esm-DnoyTjte.js";import"./zod-36FJuF1H.js";import"./transform-CRpCHU_K.js";import"./check-mTv-6WVU.js";import"./CodeSnippet-C2p1JJEZ.js";import"./file-text-CUMNV7x-.js";import"./terminal-square-Bg7ZPM8R.js";import"./ComponentIcon-CLH2B8Js.js";import"./bar-chart-square-check-Diki0CFQ.js";import"./layout-zVxDzB0C.js";function y(){var s,i;const e=b(),{componentId:t}=p(),o=g({...j.componentDetail(t),throwOnError:!0});function d(l){e(m.components.detail(l))}const c=u.useId();if(o.isPending)return r.jsx(C,{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(f,{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(x,{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(h,{children:r.jsx(y,{})})})}export{K as default};
