PageSourceSearch

https://bitstage.ai/assets/RecruiterApplicationsPage-WrGAzjE5.js

js bitstage.ai collected 2026-10-05 13:30:12 UTC 7,368 bytes, 1 lines download raw bytes

1import{a_ as F,r as a,j as e,aL as k}from"./vendor-CkXPoFMb.js";import{u as $,c,aN as H,B as j,cR as o}from"./index-CR9aNikF.js";import{S as x,t as p,O as q,o as t,a as M}from"./kit-CoEBVzQW.js";import{R as X}from"./RecruiterPageHeader-zOmYH_Jm.js";import{T as G}from"./TableListPagination-CPtNgP4x.js";import{l as P,g as J,a as K}from"./recruiterApplicationStatus-DS2ECEpO.js";import{bm as z,az as Q,a3 as V,aq as W,j as Y,X as Z,h as ee}from"./vendor-icons-DPnl4cY3.js";import"./vendor-datefns-N8mCDnaz.js";import"./vendor-jspdf-D2r6YsBm.js";import"./vendor-fingerprint-f-b5Qes_.js";import"./vendor-sanitize-8YZbVxp6.js";import"./vendor-sentry-DuxUMs8C.js";import"./vendor-motion-DvZ9ooo_.js";const se=[{value:"",label:"All"},{value:"new",label:"New"},{value:"reviewing",label:"Reviewing"},{value:"approved",label:"Approved"},{value:"rejected",label:"Rejected"}],te=["","new","reviewing","approved"],ae={new:"bg-amber-50 text-amber-700",reviewing:"bg-sky-50 text-sky-700",approved:"bg-emerald-50 text-emerald-700",rejected:"bg-rose-50 text-rose-700"};function fe(){const{toast:N}=$(),[m,v]=F(),[r,b]=a.useState(m.get("status")??""),[i,w]=a.useState(m.get("search")??""),[S,y]=a.useState(m.get("search")??""),[d,C]=a.useState(Number(m.get("page")??"1")||1),[n,E]=a.useState(Number(m.get("page_size")??"25")||25),[A,R]=a.useState(!0),[g,L]=a.useState([]),[I,O]=a.useState(0),[u,U]=a.useState({}),[h,_]=a.useState(!0);a.useEffect(()=>{C(1)},[r,i,n]),a.useEffect(()=>{const s=new URLSearchParams;r&&s.set("status",r),i&&s.set("search",i),d>1&&s.set("page",String(d)),n!==25&&s.set("page_size",String(n)),v(s,{replace:!0})},[r,i,d,n,v]),a.useEffect(()=>{let s=!1;return R(!0),P({status:r||void 0,search:i||void 0,page:d,page_size:n}).then(l=>{s||(L(l.results),O(l.count))}).catch(()=>{s||N({title:"Failed to load applications",variant:"destructive"})}).finally(()=>{s||R(!1)}),()=>{s=!0}},[r,i,d,n,N]),a.useEffect(()=>{let s=!1;return _(!0),Promise.all(te.map(l=>P({status:l||void 0,page:1,page_size:1}).then(D=>[l,D.count]).catch(()=>[l,0]))).then(l=>{s||U(Object.fromEntries(l))}).finally(()=>{s||_(!1)}),()=>{s=!0}},[i]);const f=!!(r||i),T=()=>{b(""),w(""),y("")},B=a.useMemo(()=>Array.from({length:6}),[]);return e.jsxs("div",{className:"space-y-6",children:[e.jsx(X,{className:"mb-0",title:"Recruiter applications",subtitle:"Review inbound recruiter leads, approve to send invites, or reject with an optional note."}),e.jsxs("div",{className:"grid grid-cols-2 gap-4 lg:grid-cols-4",children:[e.jsx(x,{icon:z,iconClass:p.slate,label:"Total",value:u[""]??0,loading:h}),e.jsx(x,{icon:Q,iconClass:p.amber,label:"New",value:u.new??0,loading:h}),e.jsx(x,{icon:V,iconClass:p.sky,label:"Reviewing",value:u.reviewing??0,loading:h}),e.jsx(x,{icon:W,iconClass:p.emerald,label:"Approved",value:u.approved??0,loading:h})]}),e.jsxs(q,{children:[e.jsxs("div",{className:"flex flex-col gap-3 border-b border-border/60 p-4 lg:flex-row lg:items-center lg:justify-between",children:[e.jsx("div",{className:"inline-flex flex-wrap items-center gap-1 rounded-lg bg-muted/60 p-1",children:se.map(s=>e.jsx("button",{type:"button",onClick:()=>b(s.value),className:c("rounded-md px-3 py-1.5 text-sm font-medium transition-colors",r===s.value?"bg-background text-foreground shadow-sm":"text-muted-foreground hover:text-foreground"),children:s.label},s.value||"all"))}),e.jsxs("form",{className:"flex w-full items-center gap-2 lg:w-auto",onSubmit:s=>{s.preventDefault(),w(S.trim())},children:[e.jsxs("div",{className:"relative flex-1 lg:w-72",children:[e.jsx(Y,{className:"absolute left-3 top-1/2 h-4 w-4 -translate-y-1/2 text-muted-foreground"}),e.jsx(H,{value:S,onChange:s=>y(s.target.value),placeholder:"Search name or email",className:"pl-9"})]}),e.jsx(j,{type:"submit",variant:"secondary",children:"Search"}),f?e.jsx(j,{type:"button",variant:"ghost",size:"icon",onClick:T,title:"Clear filters",children:e.jsx(Z,{className:"h-4 w-4"})}):null]})]}),e.jsx("div",{className:t.scroll,children:e.jsxs("table",{className:t.table,children:[e.jsx("thead",{children:e.jsxs("tr",{className:t.headRow,children:[e.jsx("th",{className:t.th,children:"Applicant"}),e.jsx("th",{className:t.th,children:"Country"}),e.jsx("th",{className:t.th,children:"Experience"}),e.jsx("th",{className:t.th,children:"Status"}),e.jsx("th",{className:t.th,children:"Submitted"}),e.jsx("th",{className:c(t.th,"w-10"),"aria-label":"Open"})]})}),e.jsx("tbody",{children:A?B.map((s,l)=>e.jsxs("tr",{className:t.row,children:[e.jsx("td",{className:t.td,children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx(o,{className:"h-9 w-9 rounded-full"}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(o,{className:"h-3.5 w-32"}),e.jsx(o,{className:"h-3 w-40"})]})]})}),e.jsx("td",{className:t.td,children:e.jsx(o,{className:"h-3.5 w-20"})}),e.jsx("td",{className:t.td,children:e.jsx(o,{className:"h-3.5 w-24"})}),e.jsx("td",{className:t.td,children:e.jsx(o,{className:"h-5 w-20 rounded-full"})}),e.jsx("td",{className:t.td,children:e.jsx(o,{className:"h-3.5 w-28"})}),e.jsx("td",{className:t.td})]},l)):g.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:6,className:t.empty,children:e.jsxs("div",{className:"flex flex-col items-center justify-center text-center",children:[e.jsx("span",{className:"mb-3 inline-flex h-12 w-12 items-center justify-center rounded-full bg-muted text-muted-foreground",children:e.jsx(z,{className:"h-6 w-6"})}),e.jsx("p",{className:"text-sm font-medium text-foreground",children:"No applications foun
1d"}),e.jsx("p",{className:"mt-1 text-sm text-muted-foreground",children:f?"Try adjusting your filters or search.":"New recruiter leads will appear here."}),f?e.jsx(j,{type:"button",variant:"outline",size:"sm",className:"mt-4",onClick:T,children:"Clear filters"}):null]})})}):g.map(s=>{const l=J(s.status);return e.jsxs("tr",{className:c(t.row,"group"),children:[e.jsx("td",{className:t.td,children:e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("span",{className:"inline-flex h-9 w-9 shrink-0 items-center justify-center rounded-full bg-primary/10 text-xs font-semibold text-primary",children:K(s.full_name)}),e.jsxs("div",{className:"min-w-0",children:[e.jsx(k,{to:`/ops/recruiter-applications/${s.id}`,className:"block truncate font-medium text-foreground hover:text-primary hover:underline",children:s.full_name}),e.jsx("div",{className:"truncate text-xs text-muted-foreground",children:s.email})]})]})}),e.jsx("td",{className:c(t.td,"text-foreground"),children:s.country||"-"}),e.jsx("td",{className:c(t.td,"text-muted-foreground"),children:s.years_experience_display}),e.jsx("td",{className:t.td,children:e.jsx(M,{label:s.status_display||l.label,className:ae[s.status]})}),e.jsx("td",{className:c(t.td,"text-muted-foreground"),children:new Date(s.created_at).toLocaleDateString(void 0,{year:"numeric",month:"short",day:"numeric"})}),e.jsx("td",{className:c(t.td,"text-right"),children:e.jsx(k,{to:`/ops/recruiter-applications/${s.id}`,className:"inline-flex text-muted-foreground transition-colors hover:text-foreground","aria-label":`Open ${s.full_name}`,children:e.jsx(ee,{className:"h-4 w-4 opacity-0 transition-opacity group-hover:opacity-100"})})})]},s.id)})})]})}),!A&&g.length>0?e.jsx("div",{className:"border-t border-border/60",children:e.jsx(G,{page:d,pageSize:n,total:I,onPageChange:C,onPageSizeChange:E})}):null]})]})}export{fe 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.