PageSourceSearch

https://studio.findem.ai/assets/RaasList-BHPJtH21.js

js findem.ai collected 2026-10-02 05:23:00 UTC 7,269 bytes, 1 lines download raw bytes

1import{z as E,bq as D,r as a,cf as N,j as e,J as R,d as v,a3 as z,Z as b,n as L}from"./index-_Ci2S7BU.js";import{A as T}from"./arrow-down-up-BKtold2I.js";import{C as w}from"./circle-check-big-7ifUoDBK.js";const P={created:{label:"Created",className:"bg-slate-100 text-slate-700"},intake_active:{label:"Intake in progress",className:"bg-blue-50 text-blue-700"},intake_complete:{label:"Intake complete",className:"bg-amber-50 text-amber-800"},tier_selected:{label:"Tier selected",className:"bg-violet-50 text-violet-700"},processing:{label:"Processing",className:"bg-violet-50 text-violet-700"},complete:{label:"Complete",className:"bg-emerald-50 text-emerald-700"},failed:{label:"Failed",className:"bg-red-50 text-red-700"}},A={1:"Playback Report",2:"Talent Intelligence",3:"Validated Research"};function U(l){if(!l)return"";try{return new Date(l).toLocaleString(void 0,{dateStyle:"medium"})}catch{return""}}function B(){const l=E(),u=D(),[p,y]=a.useState(""),[d,i]=a.useState([]),[g,j]=a.useState(!0),[x,k]=a.useState(""),m=a.useDeferredValue(x),[h,S]=a.useState("newest"),[C,f]=a.useState(""),o=a.useCallback(async()=>{j(!0);try{const t=new URLSearchParams,n=m.trim();n&&t.set("q",n),h==="oldest"&&t.set("sort","oldest");const s=t.toString(),r=await fetch(N(`/agentic/raas/list${s?`?${s}`:""}`),{credentials:"include"});if(r.ok){const c=await r.json();i(Array.isArray(c)?c:[])}else i([])}catch{i([])}finally{j(!1)}},[m,h]);a.useEffect(()=>{o()},[o]);const _=a.useCallback(async t=>{if(!(!t||!window.confirm("Delete this research project? This cannot be undone."))){f(t);try{const s=await fetch(N(`/agentic/raas/${t}`),{method:"DELETE",credentials:"include"});if(!s.ok){const r=await s.json().catch(()=>({}));throw new Error(r.error||"Unable to delete this research project.")}i(r=>r.filter(c=>c.id!==t))}catch(s){y(s.message||"Unable to delete this research project.")}finally{f(""),o()}}},[o]);return e.jsxs("div",{className:"mx-auto max-w-6xl px-6 py-8 sm:px-8",children:[e.jsxs("div",{className:"mb-6 flex items-center justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx("button",{onClick:()=>l("/agents"),className:"inline-flex items-center gap-2 rounded-full border border-stone-200 bg-white px-3 py-1.5 text-sm text-slate-600 transition hover:bg-stone-50 hover:text-slate-900",children:e.jsx(R,{size:15})}),e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-[0.18em] text-slate-400",children:"Exec Research"}),e.jsx("h1",{className:"mt-1 text-2xl font-semibold tracking-tight text-slate-900",children:"Exec Research Projects"})]})]}),e.jsxs("button",{onClick:()=>l("/agents/raas/new"),className:"inline-flex items-center gap-2 rounded-full bg-slate-900 px-4 py-2 text-sm font-medium text-white transition hover:bg-slate-800",children:[e.jsx(v,{size:15}),"New research project"]})]}),p&&e.jsx("div",{className:"mb-6 rounded-2xl border border-red-200 bg-red-50 px-4 py-3 text-sm text-red-800",children:p}),e.jsxs("div",{className:"rounded-[20px] border border-stone-200 bg-white p-6 shadow-sm",children:[e.jsxs("div",{className:"mb-4 flex flex-col gap-4 lg:flex-row lg:items-end lg:justify-between",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-slate-900",children:"Past research projects"}),e.jsx("p",{className:"mt-1 text-sm text-slate-500",children:"Search by client or role. Open any project to review the intake, pick a tier, or download the deliverable."})]}),e.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row",children:[e.jsxs("label",{className:"relative block",children:[e.jsx(z,{size:15,className:"pointer-events-none absolute left-3 top-1/2 -translate-y-1/2 text-slate-400"}),e.jsx("input",{type:"search",value:x,onChange:t=>k(t.target.value),placeholder:"Search research projects",className:"w-full min-w-[240px] rounded-xl border border-stone-200 bg-stone-50 py-2.5 pl-10 pr-10 text-sm outline-none transition focus:border-slate-900 focus:bg-white"}),g||x!==m?e.jsx(b,{size:15,className:"absolute right-3 top-1/2 -translate-y-1/2 animate-spin text-slate-400"}):null]}),e.jsxs("label",{className:"inline-flex items-center gap-2 rounded-xl border border-stone-200 bg-stone-50 px-3 py-2.5 text-sm text-slate-600",children:[e.jsx(T,{size:15,className:"text-slate-400"}),e.jsxs("select",{value:h,onChange:t=>S(t.target.value),className:"bg-transparent outline-none",children:[e.jsx("option",{value:"newest",children:"Newest first"}),e.jsx("option",{value:"oldest",children:"Oldest first"})]})]})]})]}),g&&d.length===0?e.jsx("div",{className:"flex items-center justify-center rounded-2xl border border-dashed border-stone-200 bg-stone-50 px-6 py-10 text-sm text-slate-500",children:e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(b,{size:16,className:"animate-spin"}),"Loading research projects..."]})}):d.length>0?e.jsx("div",{className:"space-y-3",children:d.map(t=>{const n=P[t.status]||{label:t.status||"Unknown",className:"bg-stone-100 text-slate-700"},s=t.raas_tier?A[t.raas_tier]:null,r=C===t.id;return e.jsxs("div",{className:"flex items-center gap-3 rounded-xl border border-stone-200 bg-stone-50 px-4 py-3 transition hover:border-slate-300 hover:bg-white",children:[e.jsxs("button",{type:"button",onClick:()=>l(`/agents/raas/${t.id}${u.search}`),className:"min-w-0 flex-1 text-left",children:[e.jsxs("p",{className:"text-sm font-medium text-slate-900",children:[t.project_title||t.role_title||"Untitled Role"," ",e.jsx("span",{className:"text-slate-400",children:"—"})," ",t.client_name]}),e.jsxs("p",{className:"mt-1 text-xs text-slate-500",children:[U(t.created_at),s?e.jsxs("span",{className:"ml-2 inline-flex items-center gap-1 text-violet-700",children:[e.jsx(w,{size:10})," ",s]}):null,t.has_deliverable?e.jsxs("span",{className:"ml-2 inline-flex items-center gap-1 text-emerald-600",children:[e.jsx(w,{size:10})," Deliverable ready"]}):null]})]}),e.jsx("span",{className:`shrink-0 rounded-full px-2.5 py-0.5 text-xs font-medium ${n.className}`,children:n.label}),e.jsx("button",{type:"button",onClick:()=>{_(t.id)},disabled:r,className:"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full border border-stone-200 bg-white text-slate-500 transition hover:border-red-200 hover:bg-red-50 hover:text-red-700 disabled:cursor-not-allowed disabled:opacity-60","aria-label":`Delete ${t.role_title||"research project"}`,children:r?e.jsx(b,{size:14,className:"animate-spin"}):e.jsx(L,{size:14})})]},t.id)})}):e.jsxs("div",{className:"rounded-2xl border border-dashed border-stone-200 bg-stone-50 px-6 py-14 text-center",children:[e.jsx("p",{className:"text-base font-semibold text-slate-900",children:"Start your first research project"}),e.jsx("p",{className:"mx-auto mt-2 max-w-md text-sm leading-6 text-slate-500",children:"A research project runs a voice-led intake to capture the mandate, then stages a tiered deliverable — Playback Report, Talent Intelligence Report, or Validated Research."}),e.jsxs("button",{onClick:()=>l("/agents/raas/new"),className:"mt-5 inline-flex items-center gap-2 rounded-full bg-slate-900 px-4 py-2 text-sm font-medium text-white transition hover:bg-slate-800",children:[e.jsx(v,{size:14}),"New research project"]})]})]})]})}export{B 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.