import{r as u,j as r}from"./@radix-B1sy0Lhr.js";import{B as f,F as x,W as h}from"./Wizard-2FIi8JNY.js";import{af as j,d as C,B as a,r as m}from"./index-CO6UN3UX.js";import{c as b,a as p,L as v}from"./@react-router-CHjLNlgw.js";import{b as g}from"./@tanstack-Dwlisomv.js";import{C as E}from"./configuration-form-BbcNBQTO.js";import"./@reactflow-gbyyU3kq.js";import"./index-d_QrPL-8.js";import"./form-C1jJgRy1.js";import"./plus-DOrkJCmy.js";import"./trash-D9LA4VFD.js";import"./index.esm-SBF9nn_P.js";import"./info-CI2szPUG.js";import"./zod-D48zuELD.js";import"./transform-S7omcvTm.js";import"./check-C9Nye5lR.js";import"./CodeSnippet-B7Wd4R8u.js";import"./file-text-TdPXNd7s.js";import"./terminal-square-C2tAF2XG.js";import"./ComponentIcon-C9AY8usJ.js";import"./bar-chart-square-check-_m-oYysN.js";import"./layout-GIiNvS10.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 T(){return r.jsx("section",{className:"layout-container mt-5 pb-5",children:r.jsx(h,{children:r.jsx(y,{})})})}export{T as default};
