PageSourceSearch

https://xterns.ai/assets/ClientDashboard-DsLi1PoL.js

js xterns.ai collected 2026-10-05 13:24:26 UTC 4,695 bytes, 1 lines download raw bytes

1import{j as e,r as n,J as p,B as h,L as j,U as u,bI as v,h as c,i as d,k as o,aa as N,ab as b,ac as _,m,d as y,P as w,ae as C}from"./index-DLd_kDlx.js";import{C as T}from"./ClientBusinessGate-CKL9R3zX.js";import{n as D}from"./businessManagement-BTTXtuIj.js";import{L as P}from"./loader-circle-D2miE2xB.js";import{T as S}from"./timer-CZhDpZys.js";import{T as L}from"./triangle-alert-Chqk_WK7.js";import"./briefcase-business-CphIeAJd.js";const G=()=>e.jsx(T,{children:({business:a})=>e.jsx(B,{businessId:a.id,business:a})}),A={metrics:{assigned_pods:0,total_participants:0,active_sprints:0,overdue_sprints:0,active_participants:0,inactive_participants:0,completed_participants:0,completed_pods:0,average_pod_progress:0,active_access_codes:0},pods:[],participants:[],overdue_sprints:[],tech_leads:[]},B=({businessId:a,business:t})=>{const[l,g]=n.useState(A),[f,x]=n.useState(!0);n.useEffect(()=>{(async()=>{try{x(!0),g(await D(a))}catch(i){C({title:"Unable to load dashboard",description:i instanceof Error?i.message:"Please try again.",variant:"destructive"})}finally{x(!1)}})()},[a]);const r=l.metrics;return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("div",{className:"flex flex-col gap-4 md:flex-row md:items-center md:justify-between",children:[e.jsxs("div",{children:[e.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[e.jsx("h1",{className:"text-2xl font-bold",children:t.name}),e.jsx(p,{className:"bg-emerald-100 text-emerald-800 hover:bg-emerald-100",children:"Active"})]}),e.jsx("p",{className:"text-sm text-muted-foreground",children:t.industry})]}),e.jsx("div",{className:"flex gap-2",children:e.jsx(h,{asChild:!0,variant:"outline",className:"gap-2",children:e.jsxs(j,{to:"/client/pods",children:[e.jsx(u,{className:"h-4 w-4"}),"Manage Pods"]})})})]}),f?e.jsx("div",{className:"flex justify-center py-16",children:e.jsx(P,{className:"h-6 w-6 animate-spin text-muted-foreground"})}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid gap-4 md:grid-cols-2 xl:grid-cols-4",children:[{label:"Assigned Pods",value:r.assigned_pods,icon:v,help:"Pods assigned to this business by the Xterns Super Admin."},{label:"Total Participants",value:r.total_participants,icon:u,help:"Unique active members across your business pods."},{label:"Active Sprints",value:r.active_sprints,icon:S,help:"Sprints currently marked active across all assigned pods."},{label:"Overdue Sprints",value:r.overdue_sprints,icon:L,help:"Sprints that are not completed and have passed their end date."}].map(s=>{const i=s.icon;return e.jsxs(c,{children:[e.jsxs(d,{className:"flex flex-row items-center justify-between pb-2",children:[e.jsxs(o,{className:"flex items-center gap-1 text-sm font-medium",children:[s.label,e.jsxs(N,{children:[e.jsx(b,{asChild:!0,children:e.jsx("span",{className:"cursor-help text-muted-foreground",children:"?"})}),e.jsx(_,{className:"max-w-xs",children:s.help})]})]}),e.jsx(i,{className:"h-4 w-4 text-muted-foreground"})]}),e.jsx(m,{children:e.jsx("div",{className:"text-2xl font-bold",children:s.value})})]},s.label)})}),e.jsxs("div",{className:"grid gap-6 lg:grid-cols-[1.4fr_1fr]",children:[e.jsxs(c,{children:[e.jsxs(d,{className:"flex flex-row items-center justify-between",children:[e.jsx(o,{children:"Pod Analytics"}),e.jsx(h,{asChild:!0,variant:"outline",size:"sm",className:"gap-2",children:e.jsxs(j,{to:"/client/analytics",children:[e.jsx(y,{className:"h-4 w-4"}),"View analytics"]})})]}),e.jsx(m,{className:"space-y-4",children:l.pods.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"No assigned pods yet."}):l.pods.slice(0,4).map(s=>e.jsxs("div",{className:"space-y-2 rounded-lg border p-3",children:[e.jsxs("div",{className:"flex items-center justify-between gap-3",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:s.pod_name}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[s.active_members," active, ",s.inactive_members," inactive"]})]}),e.jsx(p,{variant:"outline",className:"capitalize",children:s.status})]}),e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(w,{value:s.progress,className:"h-2"}),e.jsxs("span",{className:"w-10 text-right text-xs font-medium",children:[s.progress,"%"]})]})]},s.id))})]}),e.jsxs(c,{children:[e.jsx(d,{children:e.jsx(o,{children:"Activation Period"})}),e.jsxs(m,{className:"flex flex-col gap-2 text-sm text-muted-foreground md:flex-row md:items-center md:justify-between",children:[e.jsx("span",{children:t.description}),e.jsxs("span",{className:"shrink-0",children:[new Date(t.activation_start_date).toLocaleDateString()," - ",new Date(t.activation_end_date).toLocaleDateString()]})]})]})]})]})]})};export{G as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.