@baseplate-dev/project-builder-web
Version:
Web interface for constructing project builder JSON
3 lines (2 loc) • 1.75 kB
JavaScript
import{i as a}from"./_virtual___federation_fn_import-C4el_tlG.js";import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{J as m,A as l}from"./index--XHV4ygU.js";import{N as p}from"./new-admin-section-dialog-Cbu0HBZt.js";import{R as o}from"./index-BsqYBobW.js";import{s as x}from"./sortBy-C9bvycg5.js";const{adminSectionEntityType:u}=await a("@baseplate-dev/project-builder-lib"),{Button:h,NavigationMenu:j,NavigationMenuItemWithLink:f,NavigationMenuList:y,SidebarLayout:N,SidebarLayoutContent:S,SidebarLayoutSidebar:g}=await a("@baseplate-dev/ui-components"),{Link:r,Outlet:v}=await a("@tanstack/react-router"),C=function(){const{adminApp:c,app:i}=o.useLoaderData(),{appKey:t}=o.useParams(),d=c.sections??[],n=x(d,[s=>s.name]);return e.jsxs(N,{className:"flex-1",children:[e.jsxs(g,{className:"space-y-4",width:"sm",children:[e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs(r,{to:"/apps/edit/$key/web/admin",params:{key:t},className:"flex items-center gap-2 text-sm hover:underline",children:[e.jsx(m,{}),"Back to Admin Config"]}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold",children:i.name}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"Admin Sections"})]})]}),e.jsx("div",{className:"flex flex-col gap-4",children:e.jsx(p,{appId:i.id,appKey:t,children:e.jsxs(h,{variant:"secondary",className:"w-full",children:[e.jsx(l,{}),"New Section"]})})}),n.length>0&&e.jsx(j,{orientation:"vertical",children:e.jsx(y,{children:n.map(s=>e.jsx(f,{asChild:!0,children:e.jsx(r,{to:"/admin-sections/$appKey/edit/$sectionKey",params:{appKey:t,sectionKey:u.keyFromId(s.id)},children:s.name})},s.id))})})]}),e.jsx(S,{children:e.jsx(v,{})})]})};export{C as component};
//# sourceMappingURL=route-g7dlnXRz.js.map