UNPKG

@baseplate-dev/project-builder-web

Version:

Web interface for constructing project builder JSON

3 lines (2 loc) 1.99 kB
import{i as t}from"./_virtual___federation_fn_import-DOo8C-zl.js";import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{j as f,b as k,k as v}from"./index-DiAhmW9l.js";const{createBackendAppSchema:y}=await t("@baseplate-dev/project-builder-lib"),{useBlockUnsavedChangesNavigate:L,useDefinitionSchema:w,useProjectDefinition:A,useResettableForm:D}=await t("@baseplate-dev/project-builder-lib/web"),{FormActionBar:E,InputFieldController:g,SectionList:B,SectionListSection:l,SectionListSectionContent:p,SectionListSectionDescription:d,SectionListSectionHeader:m,SectionListSectionTitle:b,SwitchFieldController:s}=await t("@baseplate-dev/ui-components");function P(){const{saveDefinitionWithFeedback:x}=A(),{backendDefinition:n}=f.useLoaderData(),u=w(y),a=D({resolver:k(u),values:n}),{control:i,handleSubmit:j,reset:S}=a,o=j(h=>x(r=>{r.apps=r.apps.map(c=>c.id===n.id?h:c)}));return L({control:i,reset:S,onSubmit:o}),e.jsxs("form",{className:"w-full max-w-7xl space-y-4 px-4",onSubmit:o,children:[e.jsxs(B,{children:[e.jsxs(l,{children:[e.jsxs(m,{children:[e.jsx(b,{children:"General"}),e.jsx(d,{children:"Basic configuration for your backend application."})]}),e.jsx(p,{className:"space-y-6",children:e.jsx(g,{label:"Name",control:i,name:"name"})})]}),e.jsxs(l,{children:[e.jsxs(m,{children:[e.jsx(b,{children:"Configuration"}),e.jsx(d,{children:"Enable or disable external services and features for your backend application."})]}),e.jsx(p,{children:e.jsxs("div",{className:"space-y-4",children:[e.jsx(s,{control:i,name:"enableStripe",label:"Stripe",description:"Enable Stripe for payment processing"}),e.jsx(s,{control:i,name:"enableSubscriptions",label:"GraphQL Subscriptions",description:"Enable GraphQL Subscriptions for real-time updates"}),e.jsx(s,{control:i,name:"enableAxios",label:"Axios",description:"Enable Axios for HTTP requests"})]})})]}),e.jsx(v,{entityType:"app",entityId:n.id,name:n.name})]}),e.jsx(E,{form:a})]})}export{P as component}; //# sourceMappingURL=backend-BYHzgSOe.js.map