1import{F as D,t as C,y as S,r as v,j as e}from"./react-DZIhD4CV.js";import{aC as f,dQ as $,ag as O,bl as T,dK as k,dL as L,a1 as P,bm as R,bn as w,bo as z,bq as B,dr as x,ds as h,dt as g,b9 as i,ba as r,bb as o,du as j,E as I,ai as d,cP as N,k as U,q as W,a4 as q}from"./index-DYHSnDuC.js";import{D as A}from"./DeleteConfirmDialog-BaW8T_X2.js";import"./d3-q0zOtUjj.js";function Q(){const s=D(f),n=$(),l=O(),c=C(),y=S(),[E,m]=v.useState(!1),[t,u]=v.useState(()=>n.name);T("Settings | Environment");const a=k({onSuccess(){l({id:"environment-updated",type:"Success",title:"Environment Updated",description:`Environment "${t}" successfully updated.`}),c({type:"PropertyUpdated",payload:{property:{...n,name:t}}})},meta:{errorToastContent:{id:"edit-env",title:"Could not update environment"}}},{organization:s.id,environment:n.id}),p=L({onSuccess:()=>{l({type:"Success",id:"delete-env",title:"Environment Deleted",description:`Environment ${n.name} was deleted`}),c({type:"PropertyDeleted",payload:{property:n}}),y(P(s.id,q))},meta:{errorToastContent:{id:"delete-env",title:`"${n.name}" could not be deleted.`}},onSettled(){m(!1)}},{organization:s.id,environment:n.id});return e.jsxs(R,{children:[e.jsx(w,{children:e.jsx(z,{children:"Settings"})}),e.jsxs(B,{gutterY:2,children:[e.jsxs(x,{children:[e.jsx(h,{children:"General"}),e.jsxs(g,{style:{maxWidth:"600px"},children:[e.jsxs(i,{children:[e.jsx(r,{children:"Environment ID"}),e.jsx(o,{value:n.id,readOnly:!0,children:e.jsx(j,{value:n.id})})]}),e.jsxs(i,{children:[e.jsx(r,{children:"Environment Key"}),e.jsx(o,{value:n.key,readOnly:!0,children:e.jsx(j,{value:n.key})})]}),e.jsxs(i,{disabled:a.isLoading,children:[e.jsx(r,{children:"Environment Name"}),e.jsx(o,{value:t,onChange:b=>u(b.target.value)}),t!==n.name&&e.jsxs(I,{xAlign:"end",yAlign:"center",children:[e.jsx(d,{variant:"muted",onClick:()=>u(n.name),children:"Cancel"}),e.jsx(d,{size:"small",variant:"success",loading:a.isLoading,disabled:a.isLoading,onClick:()=>{a.mutate({id:n.id,changes:{name:t}})},children:"Save"})]})]})]})]}),e.jsxs(x,{children:[e.jsx(h,{children:"Danger Zone"}),e.jsx(g,{style:{maxWidth:"600px"},children:e.jsx(N,{type:"error",children:e.jsxs(U,{gap:2,children:[e.jsx(W,{$bold:!0,$color:"gray100",children:"Deleting your environment is a permanent action and cannot be undone."}),e.jsx(A,{resource:"environment",name:n.name,showPermanentWarning:!1,open:E,onOpenChange:m,isSubmitting:p.isLoading,onConfirm:()=>p.mutate(n.id),children:e.jsx(d,{size:"small",variant:"warn",style:{width:"fit-content"},children:"Delete Environment"})})]})})})]})]})]})}export{Q as default}; 2//# sourceMappingURL=general.route-BKgaC_f4.js.map
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.