PageSourceSearch

https://evolveams.ai/assets/chunks/CommitteeWorkspace-DatMEvPa.js

js evolveams.ai collected 2026-10-05 15:33:41 UTC 16,183 bytes, 1 lines download raw bytes

1import{a9 as W,j as F,b6 as G,l as e,aK as K,au as l,a7 as v,W as h,ac as u}from"./index-CBr6eDOK.js";import{B as J}from"./BackButton-CbCKBDmI.js";import{A as q,B as w,g as N,bO as Q,P as X,C as d,K as D,M as $,b as m,bP as Y,at as Z,aU as B,aW as z,a4 as ee,a5 as se,a6 as R,a7 as y,a8 as te,a9 as C}from"../app-0AIdVgIG.js";import{T as ae,a as re,b as p,c as f}from"./tabs-BLSPyjO0.js";import{R as ie}from"./RelatedTasks-CM937l2f.js";import{D as le}from"./DocumentLibrary-qViroJY6.js";import{d as ne,e as ce,f as de,g as oe,h as me}from"./useCommittees-CAikBKYz.js";import{V as xe}from"./vote-ClckAVF7.js";import{C as he}from"./circle-check-big-B1HUA3PE.js";import"./useTasks-DVO_jQN5.js";import"./customFieldErrors-hms2yvvN.js";import"./useUsers-BTivAbav.js";import"./ellipsis-JeOyUL7J.js";import"./skeleton-yoFef3wl.js";import"./switch-DuIc8pGK.js";import"./useEngagement-CUn1XIgj.js";const ue={standing:"Standing Committee",task_force:"Task Force",advisory:"Advisory Committee",governance:"Governance",special_interest:"Special Interest Group"},_={chair:"Chair",vice_chair:"Vice Chair",secretary:"Secretary",treasurer:"Treasurer",liaison:"Staff Liaison",member:"Member"};function E(n){if(!n)return"?";const r=n.trim().split(/\s+/).filter(Boolean),x=r[0]?.[0]??"",c=r.length>1?r[r.length-1][0]??"":"";return(x+c).toUpperCase()||"?"}function ge(n){return n.replace(/[._]/g," ").replace(/\b\w/g,r=>r.toUpperCase())}function je(n){const r=new Date(n).getTime();if(Number.isNaN(r))return"";const x=Date.now()-r,c=Math.round(x/6e4);if(c<1)return"just now";if(c<60)return`${c} min ago`;const t=Math.round(c/60);if(t<24)return`${t} hour${t===1?"":"s"} ago`;const i=Math.round(t/24);if(i<7)return`${i} day${i===1?"":"s"} ago`;const g=Math.round(i/7);return g<5?`${g} week${g===1?"":"s"} ago`:N(new Date(r).toISOString())}function Le(){const[,n]=W(),[r,x]=F.useState("overview"),[,c]=G("/committees/:id/workspace"),t=c?.id||"",{data:i,isLoading:g}=ne(t||null),{data:I=[]}=ce(t),{data:O=[]}=de(t),{data:V=[]}=oe(t),{data:S=[]}=me(t);if(g)return e.jsx("div",{className:"flex items-center justify-center h-64","data-testid":"workspace-loading",children:e.jsx(K,{className:"h-8 w-8 animate-spin text-muted-foreground"})});if(!i)return e.jsxs("div",{className:"flex flex-col items-center justify-center h-64 gap-4",children:[e.jsx("p",{className:"text-muted-foreground",children:"Committee not found"}),e.jsxs(l,{variant:"outline",onClick:()=>n("/committees"),children:[e.jsx(q,{className:"h-4 w-4 mr-2"})," Back to Committees"]})]});const k=I,j=k.filter(s=>s.status==="active"),P=j.find(s=>s.role==="chair"),M=new Date().toISOString().split("T")[0],T=O.filter(s=>s.status!=="cancelled").sort((s,o)=>(s.scheduledDate||"").localeCompare(o.scheduledDate||"")),A=T.filter(s=>(s.scheduledDate||"")>=M),H=T.filter(s=>(s.scheduledDate||"")<M).reverse(),a=A[0]||null,L=V.filter(s=>s.status==="voting_open"),b=s=>s.startTime&&s.endTime?`${s.startTime} - ${s.endTime}`:s.startTime||"";return e.jsxs("div",{className:"space-y-6 sm:space-y-8 max-w-6xl mx-auto px-4 sm:px-0",children:[e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx(J,{fallback:"/committees",label:"Back to Committees"}),e.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between gap-4 bg-white p-6 rounded-xl border border-border/60 shadow-sm",children:[e.jsxs("div",{className:"flex items-start gap-4",children:[e.jsx("div",{className:"h-16 w-16 rounded-xl bg-indigo-100 text-indigo-600 flex items-center justify-center flex-shrink-0 shadow-sm",children:e.jsx(v,{className:"h-8 w-8"})}),e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsxs("h1",{className:"text-2xl font-heading font-bold text-slate-900","data-testid":"workspace-committee-name",children:[i.name," Workspace"]}),e.jsx(w,{variant:"outline",className:"text-slate-600 bg-white",children:ue[i.type]||i.type})]}),e.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-1 text-sm text-muted-foreground mt-2",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(v,{className:"h-4 w-4"})," Chair: ",P?.contactName||"Vacant"]}),e.jsx("span",{className:"w-1 h-1 bg-slate-300 rounded-full hidden sm:inline-block"}),e.jsxs("span",{children:[j.length," Members"]}),e.jsx("span",{className:"w-1 h-1 bg-slate-300 rounded-full hidden sm:inline-block"}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(h,{className:"h-4 w-4"})," Next Meeting:"," ",a?N(a.scheduledDate):"None scheduled"]})]}),i.description&&e.jsx("p",{className:"text-sm text-muted-foreground mt-2 max-w-2xl",children:i.description})]})]}),e.jsxs("div",{className:"flex gap-2 w-full md:w-auto",children:[e.jsx(l,{variant:"outline",className:"flex-1 md:flex-none",asChild:!0,children:e.jsxs(u,{href:`/committees/${t}/edit`,children:[e.jsx(Q,{className:"h-4 w-4 mr-2"}),"Settings"]})}),e.jsx(l,{className:"flex-1 md:flex-none bg-indigo-600 hover:bg-indigo-700",asChild:!0,children:e.jsxs(u,{href:`/committees/${t}/meetings`,children:[e.jsx(X,{className:"h-4 w-4 mr-2"}),"New Meeting"]})})]})]})]}),e.jsxs(ae,{defaultValue:"overview",value:r,onValueChange:x,className:"space-y-6",children:[e.jsxs(re,{className:"bg-white border border-border/60 p-1 h-auto w-full justify-start overflow-x-auto shadow-sm rounded-lg",children:[e.jsx(p,{value:"overview",className:"px-4 py-2 data-[state=active]:bg-slate-100 data-[state=active]:text-slate-900",children:"Overview"}),e.jsx(p,{value:"files",className:"px-4 py-2 data-[state=active]:bg-slate-100 data-[state=active]:text-slate-900",children:"Documents"}),e.jsx(p,{value:"tasks",className:"px-4 py-2 data-[state=active]:bg-slate-100 data-[state=active]:text-slate-900",children:"Tasks"}),e.jsx(p,{value:"meetings",className:"px-4 py-2 data-[state=active]:bg-slate-100 data-[state=active]:text-slate-900",children:"Meetings"}),e.jsx(p,{value:"members",className:"px-4 py-2 data-[state=active]:bg-slate-100 data-[state=active]:text-slate-900",children:"Members"})]}),e.jsx(f,{value:"overview",className:"space-y-6",children:e.jsxs("div",{className:"grid md:grid-cols-3 gap-6",children:[e.jsxs("div",{className:"md:col-span-2 space-y-6",children:[e.jsxs(d,{className:"shadow-sm border-border/60",children:[e.jsx(D,{children:e.jsx($,{className:"text-lg",children:"Recent Activity"})}),e.jsx(m,{children:S.length>0?e.jsx("div",{className:"space-y-6","data-testid":"workspace-activity-list",children:S.slice(0,6).map(s=>e.jsxs("div",{className:"flex gap-4 items-start",children:[e.jsx("div",{className:"mt-0.5 bg-slate-50 p-2 rounded-full h-fit border border-slate-100",children:e.jsx(Y,{className:"h-4 w-4 text-slate-500"})}),e.jsxs("div",{children:[e.jsxs("p",{className:"text-sm text-slate-900",children:[e.jsx("span",{className:"font-medium",children:s.actorName||"System"})," ",ge(s.action),s.resourceName?e.jsxs(e.Fragment,{children:[" ",e.jsx("span",{className:"font-medium text-indigo-600",children:s.resourceName})]}):null]}),e.jsx("p",{className:"text-xs text-muted-foreground mt-1",children:je(s.timestamp)})]})]},s.id))}):e.jsx("p",{className:"text-sm text-muted-foreground text-center py-6","data-testid":"workspace-activity-empty",children:"No recent activity for this committee yet."})})]}),V.length>0&&e.jsxs(d,{className:"shadow-sm border-border/60","data-testid":"workspace-elections-panel",children:[e.jsxs(D,{className:"flex flex-row items-center justify-between",children:[e.jsx($,{className:"text-lg",children:"Elections"}),e.jsx(l,{variant:"ghost",size:"sm",asChild:!0,children:e.jsx(u,{href:`/committees/${t}/nominations`,children:"View All"})})]}),e.jsxs(m,{className:"space-y-3",children:[L.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"No elections with voting currently open."}),L.map(s=>{const o=s.eligibleVoterCount>0?Math.round(s.totalVotes/s.eligibleVoterCount*100):0;return e.jsxs("div",{className:"p-4 rounded-lg border border-border/60 bg-gradient-to-r from-indigo-50 to-white","data-testid":`workspace-election-${s.id}`,children:[e.jsxs("div",{className:"flex justify-between items-start mb-2",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-slate-900",children:s.title}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:[s.totalVotes," of ",s.eligibleVoterCount," votes cast"]})]}),e.jsx(w,{className:"bg-indigo-100 text-indigo-700 hover:bg-indigo-100 border-indigo-200",children:"Voting Open"})]}),e.jsxs("div",{className:"space-y-1",children:[e.jsxs("div",{className:"flex justify-between text-xs text-muted-foreground",children:[e.jsx("span",{children:"Participation"}),e.jsxs("span",{children:[o,"%"]})]}),e.jsx(Z,{value:o,className:"h-1.5"})]}),e.jsx("div",{className:"mt-3",children:e.jsx(l,{size:"sm",className:"w-full bg-white border border-indigo-200 text-indigo-700 hover:bg-indigo-50",asChild:!0,children:e.jsxs(u,{href:`/committees/${t}/nominations`,children:[e.jsx(xe,{className:"h-3.5 w-3.5 mr-1"})," ",s.currentUserHasVoted?"View Election":"Cast Vote"]})})})]},s.id)})]})]})]}),e.jsxs("div",{className:"space-y-6",children:[a?e.jsxs(d,{className:"bg-indigo-600 text-white border-none shadow-md overflow-hidden relative","data-testid":"workspace-next-meeting",children:[e.jsx("div",{className:"absolute top-0 right-0 -mr-8 -mt-8 w-32 h-32 bg-indigo-500 rounded-full opacity-20"}),e.jsx("div",{className:"absolute bottom-0 left-0 -ml-8 -mb-8 w-24 h-24 bg-indigo-400 rounded-full opacity-20"}),e.jsxs(m,{className:"p-6 relative z-10",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4 opacity-90",children:[e.jsx(h,{className:"h-4 w-4"}),e.jsx("span",{className:"text-sm font-medium uppercase tracking-wider",children:"Next Meeting"})]}),e.jsx("h3",{className:"text-xl font-bold mb-1",children:a.title}),e.jsxs("p",{className:"text-indigo-100 text-sm mb-6",children:[N(a.scheduledDate),b(a)&&` • ${b(a)}`]}),a.location&&e.jsxs("div",{className:"flex items-center gap-2 text-sm text-indigo-100 mb-6",children:[e.jsx(h,{className:"h-4 w-4"}),a.location]}),e.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[a.agendaUrl&&e.jsx(l,{variant:"secondary",size:"sm",className:"w-full text-indigo-700 hover:text-indigo-800 bg-white hover:bg-indigo-50 border-0",asChild:!0,children:e.jsx("a",{href:a.agendaUrl,target:"_blank",rel:"noopener noreferrer",children:"Agenda"})}),a.virtualMeetingLink&&e.jsx(l,{variant:"outline",size:"sm",className:"w-full border-indigo-400 text-white hover:bg-indigo-500 hover:text-white bg-transparent",asChild:!0,children:e.jsx("a",{href:a.virtualMeetingLink,target:"_blank",rel:"noopener noreferrer",children:"Join Virtual"})})]})]})]}):e.jsx(d,{className:"border-border/60 shadow-sm","data-testid":"workspace-no-next-meeting",children:e.jsxs(m,{className:"p-6 text-center",children:[e.jsx(h,{className:"h-8 w-8 mx-auto text-muted-foreground mb-2"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"No upcoming meetings scheduled"})]})}),e.jsxs(d,{className:"border-border/60 shadow-sm",children:[e.jsx(D,{className:"pb-3",children:e.jsx($,{className:"text-base",children:"Committee Members"})}),e.jsx(m,{children:j.length>0?e.jsxs("div",{className:"space-y-3","data-testid":"workspace-members-preview",children:[j.slice(0,5).map(s=>e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(B,{className:"h-8 w-8",children:e.jsx(z,{children:E(s.contactName)})}),e.jsx("div",{className:"text-sm font-medium text-slate-700",children:s.contactName||"Unknown"})]}),s.role!=="member"&&e.jsx(w,{variant:"secondary",className:"text-[10px]",children:_[s.role]||s.role})]},s.id)),e.jsxs(l,{variant:"ghost",size:"sm",className:"w-full text-muted-foreground text-xs mt-2",onClick:()=>x("members"),children:["View All ",j.length," Members"]})]}):e.jsx("p",{className:"text-sm text-muted-foreground text-center py-4",children:"No members on this committee yet."})})]})]})]})}),e.jsx(f,{value:"files",className:"space-y-6",children:e.jsx(le,{entityType:"committee",entityId:t})}),e.jsx(f,{value:"tasks",className:"space-y-6","data-testid":"committee-tasks-section",children:e.jsx(ie,{entityType:"committee",entityId:t,entityName:i.name})}),e.jsxs(f,{value:"meetings",className:"space-y-6",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("h2",{className:"text-xl font-bold text-slate-900",children:"Meetings & Minutes"}),e.jsx(l,{className:"bg-indigo-600 hover:bg-indigo-700",asChild:!0,children:e.jsxs(u,{href:`/committees/${t}/meetings`,children:[e.jsx(h,{className:"h-4 w-4 mr-2"}),"Manage Meetings"]})})]}),T.length>0?e.jsx(d,{className:"border-border/60 shadow-sm",children:e.jsx("div",{className:"divide-y divide-border/60","data-testid":"workspace-meetings-list",children:[...A,...H].map(s=>{const o=(s.scheduledDate||"")<M,U=new Date(`${s.scheduledDate}T00:00:00`);return e.jsxs("div",{className:`p-4 flex items-center justify-between hover:bg-slate-50 transition-colors ${o?"opacity-75":""}`,children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsxs("div",{className:`h-12 w-12 rounded-lg flex flex-col items-center justify-center border ${o?"bg-slate-100 text-slate-500 border-slate-200":"bg-indigo-50 text-indigo-600 border-indigo-100"}`,children:[e.jsx("span",{className:"text-xs font-bold uppercase",children:U.toLocaleStr
1ing("en-US",{month:"short"})}),e.jsx("span",{className:"text-lg font-bold",children:U.getDate()})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-medium text-slate-900",children:s.title}),e.jsxs("p",{className:"text-sm text-muted-foreground",children:[b(s),s.location&&`${b(s)?" • ":""}${s.location}`]})]})]}),e.jsxs("div",{className:"flex gap-2 items-center",children:[s.status==="completed"&&s.minutesUrl&&e.jsx(l,{variant:"ghost",size:"sm",className:"text-emerald-600 gap-1 hover:text-emerald-700 hover:bg-emerald-50",asChild:!0,children:e.jsxs("a",{href:s.minutesUrl,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(he,{className:"h-3 w-3"})," Minutes"]})}),s.agendaUrl&&e.jsx(l,{variant:"outline",size:"sm",asChild:!0,children:e.jsx("a",{href:s.agendaUrl,target:"_blank",rel:"noopener noreferrer",children:"Agenda"})})]})]},s.id)})})}):e.jsx(d,{className:"border-border/60 shadow-sm",children:e.jsxs(m,{className:"p-8 text-center","data-testid":"workspace-meetings-empty",children:[e.jsx(h,{className:"h-8 w-8 mx-auto text-muted-foreground mb-2"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"No meetings scheduled for this committee."})]})})]}),e.jsxs(f,{value:"members",className:"space-y-6",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsx("h2",{className:"text-xl font-bold text-slate-900",children:"Committee Roster"}),e.jsx(l,{className:"bg-indigo-600 hover:bg-indigo-700",asChild:!0,children:e.jsxs(u,{href:`/committees/${t}/roster`,children:[e.jsx(v,{className:"h-4 w-4 mr-2"}),"Manage Roster"]})})]}),e.jsx(d,{className:"border-border/60 shadow-sm",children:e.jsx(m,{className:"p-0",children:k.length>0?e.jsxs(ee,{"data-testid":"workspace-roster-table",children:[e.jsx(se,{children:e.jsxs(R,{children:[e.jsx(y,{children:"Name"}),e.jsx(y,{children:"Role"}),e.jsx(y,{children:"Term"}),e.jsx(y,{children:"Status"})]})}),e.jsx(te,{children:k.map(s=>e.jsxs(R,{children:[e.jsx(C,{className:"font-medium",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(B,{className:"h-8 w-8",children:e.jsx(z,{children:E(s.contactName)})}),s.contactName||"Unknown"]})}),e.jsx(C,{children:_[s.role]||s.role}),e.jsx(C,{children:s.termStartDate&&s.termEndDate?`${N(s.termStartDate)} - ${N(s.termEndDate)}`:"Ongoing"}),e.jsx(C,{children:e.jsx(w,{variant:"outline",className:s.status==="active"?"bg-emerald-50 text-emerald-700 border-emerald-200":"bg-slate-50 text-slate-600 border-slate-200",children:s.status})})]},s.id))})]}):e.jsxs("div",{className:"p-8 text-center","data-testid":"workspace-roster-empty",children:[e.jsx(v,{className:"h-8 w-8 mx-auto text-muted-foreground mb-2"}),e.jsx("p",{className:"text-sm text-muted-foreground",children:"No members on this committee yet."})]})})})]})]})]})}export{Le 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.