import{i}from"./_virtual___federation_fn_import-DB-0B1B_.js";import{j as e}from"./jsx-runtime-u17CrQMm.js";import{u as p}from"./use-enum-form-BxerQuZY.js";import{E as h}from"./enum-info-form-DBuiSsqs.js";const{useBlockBeforeContinue:x}=await i("@baseplate-dev/project-builder-lib/web"),{Button:n,Dialog:f,DialogClose:j,DialogContent:g,DialogDescription:b,DialogFooter:C,DialogHeader:D,DialogTitle:E,DialogTrigger:S,SwitchFieldController:w,useControlledState:v}=await i("@baseplate-dev/ui-components");function O({trigger:t,open:r,onOpenChange:a}){const[l,o]=v(r,a,!1),{onSubmit:c,form:{control:s},isSavingDefinition:m}=p({isCreate:!0,onSubmitSuccess:()=>{o(!1)}}),u=x();return e.jsxs(f,{open:l,onOpenChange:d=>{d?u({onContinue:()=>{o(!0)}}):o(!1)},children:[e.jsx(S,{render:t}),e.jsxs(g,{children:[e.jsxs(D,{children:[e.jsx(E,{children:"New Enum"}),e.jsx(b,{children:"Enums are a list of values that can be used in your data models."})]}),e.jsxs("form",{onSubmit:c,className:"space-y-4",children:[e.jsx(h,{control:s}),e.jsx(w,{label:"Expose in GraphQL schema",control:s,name:"isExposed",description:"Whether to expose this enum in the GraphQL schema"}),e.jsxs(C,{children:[e.jsx(j,{render:e.jsx(n,{variant:"secondary"}),children:"Cancel"}),e.jsx(n,{type:"submit",disabled:m,children:"Create Enum"})]})]})]})]})}export{O as N};
//# sourceMappingURL=new-enum-dialog-BJIUIL9P.js.map
