UNPKG

@baseplate-dev/project-builder-web

Version:

Web interface for constructing project builder JSON

3 lines (2 loc) 1.77 kB
import{i as s}from"./_virtual___federation_fn_import-C4el_tlG.js";import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{K as c}from"./index--XHV4ygU.js";import{N as m}from"./new-admin-section-dialog-Cbu0HBZt.js";import{c as o}from"./index-BsqYBobW.js";const{adminSectionEntityType:l}=await s("@baseplate-dev/project-builder-lib"),{Button:r,Card:p,EmptyDisplay:x}=await s("@baseplate-dev/ui-components"),{Link:h}=await s("@tanstack/react-router"),S=function(){const{adminApp:d,app:a}=o.useLoaderData(),{appKey:i}=o.useParams(),n=d.sections??[];return n.length===0?e.jsx(x,{icon:c,header:"No Admin Sections",subtitle:"Create your first admin section to get started with managing your data",actions:e.jsx(m,{appId:a.id,appKey:i,children:e.jsx(r,{children:"New Section"})})}):e.jsxs("div",{className:"space-y-4 p-4",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl font-bold",children:[a.name," Admin Sections"]}),e.jsx("p",{className:"text-muted-foreground",children:"Manage CRUD interfaces for your data models. Select a section from the sidebar to edit it."})]}),e.jsx("div",{className:"grid gap-4 md:grid-cols-2 lg:grid-cols-3",children:n.map(t=>e.jsx(p,{className:"p-4",children:e.jsxs("div",{className:"space-y-2",children:[e.jsx("h3",{className:"font-semibold",children:t.name||"Unnamed Section"}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Type: ",t.type]}),t.icon&&e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Icon: ",t.icon]}),e.jsx(h,{to:"/admin-sections/$appKey/edit/$sectionKey",params:{appKey:i,sectionKey:l.keyFromId(t.id)},className:"inline-block",children:e.jsx(r,{variant:"secondary",size:"sm",children:"Edit"})})]})},t.id))})]})};export{S as component}; //# sourceMappingURL=index-BEWp-FTp.js.map