import{i as n}from"./_virtual___federation_fn_import-DB-0B1B_.js";import{j as e}from"./jsx-runtime-u17CrQMm.js";import{H as m}from"./index-COBNNDEP.js";import{l as f}from"./error-formatter-B41KnHG1.js";import{R as p}from"./route-C-U30Y7-.js";const{useProjectDefinition:x}=await n("@baseplate-dev/project-builder-lib/web"),{Badge:h,Button:g,DropdownMenu:b,DropdownMenuContent:j,DropdownMenuGroup:v,DropdownMenuItem:w,DropdownMenuTrigger:y,useConfirmDialog:k}=await n("@baseplate-dev/ui-components"),{Outlet:D,useNavigate:M}=await n("@tanstack/react-router");function B(){const{definition:r,saveDefinitionWithFeedbackSync:s,isSavingDefinition:o}=x(),l=M(),{requestConfirm:c}=k(),{pkg:i}=p.useLoaderData(),{packageScope:a}=r.settings.general;function d(){s(t=>{t.libraries=t.libraries.filter(u=>u.id!==i.id)},{successMessage:"Successfully unlinked library!",disableDeleteRefDialog:!0,onSuccess:()=>{l({to:"/packages"}).catch(f)}})}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",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("h2",{children:a?`@${a}/${i.name}`:i.name}),e.jsx(h,{variant:"secondary",children:i.type})]}),e.jsxs(b,{children:[e.jsx(y,{render:e.jsx(g,{variant:"ghost",size:"icon"}),children:e.jsx(m,{"aria-label":"More Actions"})}),e.jsx(j,{children:e.jsx(v,{children:e.jsx(w,{variant:"destructive",disabled:o,onClick:()=>{c({title:"Unlink Library",content:`Are you sure you want to unlink ${i.name}? The library will be removed from Baseplate but generated files will remain on disk.`,onConfirm:d})},children:"Unlink Library"})})})]})]})}),e.jsx("div",{className:"mb-(--action-bar-height) flex flex-1 overflow-y-auto",style:{"--action-bar-height":"52px"},children:e.jsx(D,{})})]},i.id)}export{B as component};
//# sourceMappingURL=route-DAcX5Evi.js.map
