UNPKG

@baseplate-dev/project-builder-web

Version:

Web interface for constructing project builder JSON

3 lines (2 loc) 2.15 kB
import{i as s}from"./_virtual___federation_fn_import-C4el_tlG.js";import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{f as l,l as x}from"./index-BsqYBobW.js";const{useProjectDefinition:u}=await s("@baseplate-dev/project-builder-lib/web"),{Button:t,Dialog:m,DialogClose:f,DialogContent:g,DialogFooter:j,DialogHeader:v,DialogTitle:D,DialogTrigger:y}=await s("@baseplate-dev/ui-components"),{Outlet:b,useNavigate:w}=await s("@tanstack/react-router"),A=function(){const{saveDefinitionWithFeedbackSync:o,definition:r,isSavingDefinition:c}=u(),{app:a}=l.useLoaderData(),d=w({from:l.fullPath}),p=()=>{o(n=>{n.apps=n.apps.filter(h=>h.id!==a.id)},{successMessage:"Successfully unlinked app!",disableDeleteRefDialog:!0,onSuccess:()=>{d({to:"/apps"}).catch(x)}})},{packageScope:i}=r.settings.general;return e.jsxs("div",{className:"relative flex h-full flex-1 flex-col overflow-hidden",children:[e.jsx("div",{className:"max-w-7xl space-y-4 p-4",children:e.jsxs("div",{className:"flex items-center justify-between space-x-4",children:[e.jsxs("div",{children:[e.jsx("h2",{children:i?`@${i}/${a.name}`:a.name}),e.jsxs("p",{className:"text-base text-muted-foreground",children:[a.type," app"]})]}),e.jsxs(m,{children:[e.jsx(y,{asChild:!0,children:e.jsx(t,{variant:"secondary",children:"Delete"})}),e.jsxs(g,{children:[e.jsx(v,{children:e.jsxs(D,{children:["Delete ",a.name]})}),e.jsxs("p",{children:["Are you sure you want to delete ",e.jsx("strong",{children:a.name}),"?"]}),e.jsx("p",{className:"text-style-muted",children:"This action will unlink the app from the generation process, so it will no longer be updated or managed through Baseplate. If already generated, the app will remain on the file system. You can manually delete it afterwards if no longer needed."}),e.jsxs(j,{children:[e.jsx(f,{children:e.jsx(t,{variant:"secondary",children:"Cancel"})}),e.jsx(t,{variant:"destructive",onClick:p,disabled:c,children:"Unlink App"})]})]})]})]})}),e.jsx("div",{className:"mb-(--action-bar-height) flex flex-1 overflow-y-auto",style:{"--action-bar-height":"52px"},children:e.jsx(b,{})})]},a.id)};export{A as component}; //# sourceMappingURL=route-BeHZ-rmE.js.map