import{r as u,j as r}from"./@radix-C7hRs6Kx.js";import{B as f,F as x,W as h}from"./Wizard-CMI6Ksgz.js";import{X as j,S as C,h as a,r as m}from"./index-D2iSHVZq.js";import{c as b,a as p,L as v}from"./@react-router-CNP6g_RL.js";import{a as g}from"./@tanstack-CSxjHCME.js";import{C as E}from"./configuration-form-BtI2Y4eX.js";import"./@reactflow-CQi1Z1Wq.js";import"./index-CmLcvK2z.js";import"./plus-COjQg3AG.js";import"./trash-BWSZ7NRK.js";import"./index.esm-D7jFlf5N.js";import"./type-guards-CaeD8wHO.js";import"./index-CFESYpe4.js";import"./zod-C0xYeTvL.js";import"./ComponentIcon-ils7uNAk.js";import"./layout-h3cbx8WZ.js";import"./rocket-Cf-B-XOR.js";import"./check-DK77doTf.js";import"./CodeSnippet-CvI6D0wx.js";import"./file-text-BdxZdjP_.js";import"./terminal-square-DMtel8mb.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};
