import{a4 as l,aL as C,bT as U,h as r,i as n,o as p,es as S,b as x,aT as f,ag as g,j as s,e9 as R}from"./app-BgLa5dit.js";import{B as h}from"./3nM7jLnE.chunk.js";import{C as E}from"./ChrB5FYK.chunk.js";import{a as T}from"./DR2FaZH9.chunk.js";import{s as _}from"./8iu0vnCW.chunk.js";function O(e,a,o){const c=a(l.UserGroup),u=a(l.UserOptions);let t=[{id:"overview",text:"Overview",appLink:{application:n.CRM_STUDIO,action:r.CrmStudio.USER_OVERVIEW,args:[e]}},{id:"schools",text:"Customer schools",appLink:{application:n.CRM_STUDIO,action:r.CrmStudio.USER_CUSTOMER_SCHOOLS,args:[e]}},{id:"groups",text:"Curator groups",appLink:{application:n.CRM_STUDIO,action:r.CrmStudio.USER_MANAGE_CURATOR_GROUPS,args:[e]}},{id:"features",text:"Feature flags",appLink:{application:n.CRM_STUDIO,action:r.CrmStudio.USER_FEATURE_FLAGS,args:[e]}},{id:"settings",text:"User settings",appLink:{application:n.CRM_STUDIO,action:r.CrmStudio.USER_SETTINGS,args:[e]}},{id:"usage",text:"Usage",appLink:{application:n.CRM_STUDIO,action:r.CrmStudio.USER_WORKSPACE_USAGE,args:[e]}}];const d=o&&C.getUserType(o)===U.Learner;return(!c||d)&&(t=t.filter(i=>i.id!=="groups")),u||(t=t.filter(i=>i.id!=="settings"&&i.id!=="features")),t}function M(e){var d,i;const a=p(S.user(e.id)),o=p(S.getCustomers(e.id)),{hasPermissions:c,isLoading:u}=x(),m=O(e.id,c,a.data);if(f.useEffect(()=>{!a.data||!a.data.id||T(a.data.id,g.User)},[a.hasCompleted]),!a.hasCompleted||!o.hasCompleted||u)return s.jsx(s.Fragment,{});const t=((d=a.data)==null?void 0:d.name)+" "+((i=a.data)==null?void 0:i.surname);return s.jsxs("div",{className:"d-flex flex-column gap-4",children:[s.jsx("div",{className:"d-flex flex-row justify-content-between",children:s.jsxs("div",{children:[s.jsxs("p",{children:[t," · ",e.id]}),s.jsx("h1",{children:e.title}),s.jsx(h,{breadcrumbs:[{name:"Curation Studio"},{name:"Users",appLink:{application:n.CRM_STUDIO,action:r.CrmStudio.USERS}},{name:`${t} · ${e.id}`,active:!0}]})]})}),s.jsxs("div",{className:"w-100 h-100 d-flex flex-row gap-3",children:[s.jsx("div",{className:_.customerNav,children:s.jsx(E,{currentTabId:e.currentTabId,items:m})}),s.jsx("div",{className:"flex-grow-1",children:e.loading?s.jsx(R,{}):e.children})]})]})}export{M as C};
//# sourceMappingURL=B20c1N-e.chunk.js.map
