UNPKG

decocms

Version:

Deco CMS — Self-hostable MCP Gateway for managing AI connections and tools

2 lines (1 loc) • 2.61 kB
import{c as p,j as s,b as y,P as b,O as _,h as g,B as S,L as j,k as v,l as A,m as N}from"./index-ztdGKvBm.js";import{R}from"./required-auth-layout-Cwtu4iIe.js";import{u as T}from"./use-deployment-admin-Cr4LWHG9.js";const D=[{to:"/_admin/users",labelKey:"admin.layout.usersTab"},{to:"/_admin/orgs",labelKey:"admin.layout.organizationsTab"},{to:"/_admin/prompts",labelKey:"admin.layout.promptsTab"}];function K(){const e=p.c(6);let a;e[0]===Symbol.for("react.memo_cache_sentinel")?(a={select:L},e[0]=a):a=e[0];const d=A(a),r=y();let t;e[1]!==d||e[2]!==r?(t=D.map(o=>s.jsx(j,{to:o.to,className:N("-mb-px border-b-2 px-3 py-2.5 text-sm font-medium transition-colors",d.startsWith(o.to)?"border-foreground text-foreground":"border-transparent text-muted-foreground hover:text-foreground"),children:r(o.labelKey)},o.to)),e[1]=d,e[2]=r,e[3]=t):t=e[3];let n;return e[4]!==t?(n=s.jsx("nav",{className:"flex items-center gap-1 border-b border-border px-4 md:px-10",children:t}),e[4]=t,e[5]=n):n=e[5],n}function L(e){return e.location.pathname}function k(){const e=p.c(22),{isAdmin:a,loading:d,needsEmailVerification:r}=T(),t=y();if(d){let i;return e[0]===Symbol.for("react.memo_cache_sentinel")?(i=s.jsx("div",{className:"flex h-dvh flex-1 items-center justify-center",children:s.jsx(g,{className:"size-5 text-muted-foreground"})}),e[0]=i):i=e[0],i}if(!a){let i;e[1]!==t?(i=t("admin.layout.adminDashboardArea"),e[1]=t,e[2]=i):i=e[2];let l;e[3]!==r||e[4]!==t?(l=t(r?"admin.layout.emailVerificationRequired":"admin.layout.restrictedToDashboard"),e[3]=r,e[4]=t,e[5]=l):l=e[5];let m;e[6]!==t?(m=t("admin.layout.goHome"),e[6]=t,e[7]=m):m=e[7];let c;e[8]!==m?(c=s.jsx(S,{variant:"outline",size:"sm",asChild:!0,children:s.jsx(j,{to:"/",children:m})}),e[8]=m,e[9]=c):c=e[9];let h;return e[10]!==i||e[11]!==l||e[12]!==c?(h=s.jsx(v,{area:i,description:l,action:c}),e[10]=i,e[11]=l,e[12]=c,e[13]=h):h=e[13],h}let n;e[14]!==t?(n=t("admin.layout.adminDashboard"),e[14]=t,e[15]=n):n=e[15];let o;e[16]!==n?(o=s.jsx("div",{className:"shrink-0 px-4 pt-6 md:px-10",children:s.jsx("h1",{className:"pb-4 text-xl font-medium",children:n})}),e[16]=n,e[17]=o):o=e[17];let u;e[18]===Symbol.for("react.memo_cache_sentinel")?(u=s.jsx(K,{}),e[18]=u):u=e[18];let f;e[19]===Symbol.for("react.memo_cache_sentinel")?(f=s.jsx(b.Content,{children:s.jsx(_,{})}),e[19]=f):f=e[19];let x;return e[20]!==o?(x=s.jsxs(b,{variant:"plain",className:"h-dvh",children:[o,u,f]}),e[20]=o,e[21]=x):x=e[21],x}function P(){const e=p.c(1);let a;return e[0]===Symbol.for("react.memo_cache_sentinel")?(a=s.jsx(R,{children:s.jsx(k,{})}),e[0]=a):a=e[0],a}export{P as default};