UNPKG

@baseplate-dev/project-builder-web

Version:

Web interface for constructing project builder JSON

3 lines (2 loc) 1.75 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 m,A as l}from"./index-G5ZRloOW.js";import{N as p}from"./new-admin-section-dialog-CDleRfyj.js";import{R as o}from"./index-DiAhmW9l.js";import{s as x}from"./sortBy-C9bvycg5.js";const{adminSectionEntityType:u}=await t("@baseplate-dev/project-builder-lib"),{Button:h,NavigationMenu:j,NavigationMenuItemWithLink:f,NavigationMenuList:y,SidebarLayout:N,SidebarLayoutContent:g,SidebarLayoutSidebar:v}=await t("@baseplate-dev/ui-components"),{Link:r,Outlet:S}=await t("@tanstack/react-router");function B(){const{adminApp:c,app:i}=o.useLoaderData(),{appKey:s}=o.useParams(),d=c.sections??[],n=x(d,[a=>a.name]);return e.jsxs(N,{className:"flex-1",children:[e.jsxs(v,{className:"space-y-4",width:"sm",children:[e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsxs(r,{to:"/packages/apps/$key/web/admin",params:{key:s},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:s,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(a=>e.jsx(f,{asChild:!0,children:e.jsx(r,{to:"/admin-sections/$appKey/edit/$sectionKey",params:{appKey:s,sectionKey:u.keyFromId(a.id)},children:a.name})},a.id))})})]}),e.jsx(g,{children:e.jsx(S,{})})]})}export{B as component}; //# sourceMappingURL=route-qlk5q6-J.js.map