import{i}from"./_virtual___federation_fn_import-DB-0B1B_.js";import{j as e}from"./jsx-runtime-u17CrQMm.js";import{H as p}from"./index-COBNNDEP.js";import{l as m}from"./error-formatter-B41KnHG1.js";const{useProjectDefinition:f}=await i("@baseplate-dev/project-builder-lib/web"),{Badge:g,Button:h,DropdownMenu:j,DropdownMenuContent:x,DropdownMenuGroup:b,DropdownMenuItem:v,DropdownMenuTrigger:w,useConfirmDialog:D}=await i("@baseplate-dev/ui-components"),{useNavigate:k}=await i("@tanstack/react-router");function C({app:n}){const{definition:o,saveDefinitionWithFeedbackSync:r,isSavingDefinition:a}=f(),c=k(),{requestConfirm:l}=D(),{packageScope:t}=o.settings.general;function d(){r(s=>{s.apps=s.apps.filter(u=>u.id!==n.id)},{successMessage:"Successfully unlinked app!",disableDeleteRefDialog:!0,onSuccess:()=>{c({to:"/packages"}).catch(m)}})}return e.jsxs("div",{className:"flex items-center justify-between border-b p-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("h2",{children:t?`@${t}/${n.name}`:n.name}),e.jsx(g,{variant:"secondary",children:n.type})]}),e.jsxs(j,{children:[e.jsx(w,{render:e.jsx(h,{variant:"ghost",size:"icon"}),children:e.jsx(p,{"aria-label":"More Actions"})}),e.jsx(x,{children:e.jsx(b,{children:e.jsx(v,{variant:"destructive",disabled:a,onClick:()=>{l({title:"Unlink App",content:`Are you sure you want to unlink ${n.name}? The app will be removed from Baseplate but generated files will remain on disk.`,onConfirm:d})},children:"Unlink App"})})})]})]})}export{C as A};
//# sourceMappingURL=app-header-bar-ChGnmayX.js.map
