UNPKG

@baseplate-dev/project-builder-web

Version:

Web interface for constructing project builder JSON

3 lines (2 loc) 2.63 kB
import{i as t}from"./_virtual___federation_fn_import-DOo8C-zl.js";import{j as e}from"./jsx-runtime-D_zvdyIk.js";import{h}from"./index-G5ZRloOW.js";import{N as y}from"./new-dialog-Dom1lleR.js";import{s as c}from"./sortBy-C9bvycg5.js";const{appEntityType:j,AppUtils:u,libraryEntityType:g,LibraryUtils:f}=await t("@baseplate-dev/project-builder-lib"),{useProjectDefinition:N}=await t("@baseplate-dev/project-builder-lib/web"),{Badge:l,Button:b,Card:p,EmptyDisplay:k}=await t("@baseplate-dev/ui-components"),{Link:d}=await t("@tanstack/react-router");function E(){const{definition:n}=N(),{apps:m,libraries:x=[]}=n,o=n.settings.monorepo,r=c(m,[s=>s.name]),a=c(x,[s=>s.name]);return r.length===0&&a.length===0?e.jsx(k,{icon:h,header:"No Apps or Packages",subtitle:"You haven't created any apps or packages yet",actions:e.jsx(y,{children:e.jsx(b,{children:"Create New"})})}):e.jsxs("div",{className:"space-y-6 p-4",children:[e.jsxs("section",{className:"space-y-4",children:[e.jsx("h1",{children:"Apps"}),e.jsx("p",{className:"text-muted-foreground",children:"These are the apps that are defined in your project."}),r.length>0?e.jsx("div",{className:"mt-4 flex max-w-xl flex-col gap-4",children:r.map(s=>{const i=u.getAppDirectory(s,o);return e.jsx(d,{to:"/packages/apps/$key",params:{key:j.keyFromId(s.id)},children:e.jsxs(p,{className:"cursor-pointer p-4 transition-colors hover:bg-accent/50",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{children:s.name}),e.jsx(l,{variant:"secondary",children:s.type})]}),e.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:["Location: ",i]})]})},s.id)})}):e.jsx("p",{className:"mt-4 text-sm text-muted-foreground",children:"No apps yet."})]}),e.jsxs("section",{className:"space-y-4",children:[e.jsx("h2",{children:"Libraries"}),e.jsx("p",{className:"text-muted-foreground",children:"Library packages that can be shared across apps."}),a.length>0?e.jsx("div",{className:"mt-4 flex max-w-xl flex-col gap-4",children:a.map(s=>{const i=f.getLibraryDirectory(s,o);return e.jsx(d,{to:"/packages/libs/$key",params:{key:g.keyFromId(s.id)},children:e.jsxs(p,{className:"cursor-pointer p-4 transition-colors hover:bg-accent/50",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsx("h3",{children:s.name}),e.jsx(l,{variant:"secondary",children:s.type})]}),e.jsxs("p",{className:"mt-1 text-sm text-muted-foreground",children:["Location: ",i]})]})},s.id)})}):e.jsx("p",{className:"mt-4 text-sm text-muted-foreground",children:"No libraries yet."})]})]})}export{E as component}; //# sourceMappingURL=index-Bk5Uzq4S.js.map