1import{r as a,P as S,j as e,bR as w,bf as k,L as E}from"./index-Bt-9XfGi.js";import{a as C,b as R,c as m,H as I}from"./talent-chrome-DL8jGJFo.js";import{l as L}from"./talent-base.functions-Dw-w5MDb.js";const _=50;function H(){const[n,j]=a.useState(""),[r,b]=a.useState([]),[p,y]=a.useState(0),[u,N]=a.useState(null),[o,h]=a.useState(!0),[x,f]=a.useState(!1),l=a.useRef(0),d=a.useCallback(async(t,s,T)=>{const c=l.current+=1;h(!0);try{const g=await S();if(!g)throw new Error("Signed out");const i=await L({data:{accessToken:g,query:t,offset:s,pageSize:_}});if(c!==l.current)return;b(v=>T?[...v,...i.rows]:i.rows),y(i.total),N(i.nextOffset),f(!1)}catch{c===l.current&&f(!0)}finally{c===l.current&&h(!1)}},[]);return a.useEffect(()=>{const t=setTimeout(()=>{d(n,0,!1)},n?250:0);return()=>clearTimeout(t)},[n,d]),e.jsxs(w,{children:[e.jsx(C,{register:"Candidates",title:"Candidates",lede:"A candidate belongs to Talentplay, not to a single search. What a search knows about the person stays in Search; the person stays here.",count:p,countLabel:"in the base"}),e.jsx(R,{value:n,onChange:j,placeholder:"Search by name, title, company or email"}),o?e.jsx(m,{children:"Reading the base."}):null,x?e.jsx(m,{children:"The base could not be read just now."}):null,e.jsx("ul",{className:"mt-2",children:r.map(t=>e.jsxs("li",{className:"grid grid-cols-[auto_minmax(0,1.1fr)_minmax(0,1fr)_minmax(0,1.1fr)] items-start gap-6 border-b border-[color:var(--app-border)] py-6",children:[e.jsx(k,{name:t.displayName}),e.jsxs("div",{children:[e.jsx(E,{to:"/talent/candidates/$id",params:{id:t.id},className:"font-display text-[19px] leading-tight underline-offset-4 hover:underline",children:t.displayName}),e.jsx("p",{className:"mt-1 text-[13px] text-[color:var(--app-ink-muted)]",children:[t.professionalTitle,t.company].filter(Boolean).join(", ")||"Title not added yet"})]}),e.jsxs("div",{className:"text-[13px] text-[color:var(--app-ink-muted)]",children:[e.jsx("p",{children:t.email??"No email recorded"}),t.phone?e.jsx("p",{className:"mt-1 text-[12.5px] text-[color:var(--app-ink-dim)]",children:t.phone}):null]}),e.jsx(I,{items:t.assignments.map(s=>({assignmentId:s.assignmentId,roleTitle:s.roleTitle,clientName:s.clientName,note:s.stage})),empty:"No search history yet."})]},t.id))}),r.length>0?e.jsxs("div",{className:"mt-8 flex flex-wrap items-center gap-6",children:[e.jsxs("p",{className:"font-mono text-[11.5px] tabular-nums text-[color:var(--app-ink-dim)]",children:["Showing ",r.length," of ",p]}),u!==null?e.jsx("button",{type:"button",disabled:o,onClick:()=>{d(n,u,!0)},className:"app-btn app-btn--action inline-flex h-[var(--control-h)] items-center justify-center rounded-[var(--control-r)] px-4 text-[length:var(--control-fs)] font-semibold tracking-tight",children:o?"Reading":"Show more"}):null]}):null,!o&&!x&&r.length===0?e.jsx(m,{children:"No candidate matches that."}):null]})}export{H as component};
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.