PageSourceSearch

https://classsight.ai/assets/ApplicationsDashboard-DmU0qPwW.js

js classsight.ai collected 2026-10-02 00:26:38 UTC 8,511 bytes, 1 lines download raw bytes

1import{j as e}from"./vendor-markdown-Daxr8BJC.js";import{r as d}from"./vendor-charts-qvx8-m0G.js";import{_ as z,z as y,Y as S,b as j,af as H,C as o,d as x,U as C,a as i,B as M,S as V,I as P,ac as O,D as Q,G as $,aP as G,E as Y}from"./index-DomUViA2.js";import{S as A,a as k,b as R,c as D,d as r}from"./select-DQl_0Prn.js";import{T as q,a as J,b as T,c as n,d as K,e as c}from"./table-2JwoYJH_.js";import{A as W}from"./arrow-left-Dm8Znr56.js";import{F as X}from"./filter-B-mLNcwP.js";import{F as Z}from"./flame-BHlJ4_O-.js";import{D as ee}from"./download-Bu4HsJ2t.js";import{f as se}from"./format-DxQEMY0O.js";import"./vendor-pdf-SjvVsPhg.js";import"./index-BdQq_4o_.js";import"./en-US-BkOM94b8.js";const te=a=>a===null?"bg-muted text-muted-foreground":a>=70?"bg-green-500/20 text-green-700 dark:text-green-400":a>=50?"bg-yellow-500/20 text-yellow-700 dark:text-yellow-400":"bg-red-500/20 text-red-700 dark:text-red-400",re=a=>{switch(a){case"new":return"bg-blue-500/20 text-blue-700 dark:text-blue-400";case"reviewing":return"bg-yellow-500/20 text-yellow-700 dark:text-yellow-400";case"interviewed":return"bg-purple-500/20 text-purple-700 dark:text-purple-400";case"hired":return"bg-green-500/20 text-green-700 dark:text-green-400";case"rejected":return"bg-red-500/20 text-red-700 dark:text-red-400";default:return"bg-muted text-muted-foreground"}};function ge(){const a=z(),[l,L]=d.useState([]),[F,v]=d.useState(!0),[h,U]=d.useState(""),[f,E]=d.useState("all"),[g,B]=d.useState("created_at");d.useEffect(()=>{N()},[]);const N=async()=>{v(!0);try{const{data:s,error:t}=await y.from("job_applications").select("*").order("created_at",{ascending:!1});if(t)throw t;L(s||[])}catch(s){console.error("Error fetching applications:",s),S.error("Failed to load applications")}finally{v(!1)}},w=l.filter(s=>{const t=s.full_name.toLowerCase().includes(h.toLowerCase())||s.email.toLowerCase().includes(h.toLowerCase())||s.position.toLowerCase().includes(h.toLowerCase()),m=f==="all"||s.status===f;return t&&m}).sort((s,t)=>g==="ai_fit_score"?(t.ai_fit_score||0)-(s.ai_fit_score||0):g==="ai_drive_score"?(t.ai_drive_score||0)-(s.ai_drive_score||0):new Date(t.created_at).getTime()-new Date(s.created_at).getTime()),u={total:l.length,new:l.filter(s=>s.status==="new").length,reviewing:l.filter(s=>s.status==="reviewing").length,avgScore:l.filter(s=>s.ai_fit_score!==null).length>0?Math.round(l.filter(s=>s.ai_fit_score!==null).reduce((s,t)=>s+(t.ai_fit_score||0),0)/l.filter(s=>s.ai_fit_score!==null).length):0},I=async(s,t)=>{try{const{data:m,error:b}=await y.storage.from("resumes").download(s);if(b)throw b;const _=URL.createObjectURL(m),p=document.createElement("a");p.href=_,p.download=`${t.replace(/\s+/g,"_")}_Resume.pdf`,p.click(),URL.revokeObjectURL(_)}catch(m){console.error("Error downloading resume:",m),S.error("Failed to download resume")}};return e.jsx("div",{className:"min-h-screen bg-background",children:e.jsxs("div",{className:"container mx-auto px-4 py-8",children:[e.jsxs("div",{className:"flex items-center justify-between mb-8",children:[e.jsxs("div",{className:"flex items-center gap-4",children:[e.jsx(j,{variant:"ghost",size:"icon",onClick:()=>a(-1),children:e.jsx(W,{className:"h-5 w-5"})}),e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold text-foreground",children:"Applications Dashboard"}),e.jsx("p",{className:"text-muted-foreground",children:"AI-powered candidate screening and management"})]})]}),e.jsxs(j,{onClick:N,variant:"outline",size:"sm",children:[e.jsx(H,{className:"h-4 w-4 mr-2"}),"Refresh"]})]}),e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-4 mb-8",children:[e.jsx(o,{children:e.jsx(x,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Total Applications"}),e.jsx("p",{className:"text-2xl font-bold",children:u.total})]}),e.jsx(C,{className:"h-8 w-8 text-primary opacity-80"})]})})}),e.jsx(o,{children:e.jsx(x,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"New Applications"}),e.jsx("p",{className:"text-2xl font-bold",children:u.new})]}),e.jsx(i,{className:"bg-blue-500/20 text-blue-700",children:"New"})]})})}),e.jsx(o,{children:e.jsx(x,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Under Review"}),e.jsx("p",{className:"text-2xl font-bold",children:u.reviewing})]}),e.jsx(i,{className:"bg-yellow-500/20 text-yellow-700",children:"Reviewing"})]})})}),e.jsx(o,{children:e.jsx(x,{className:"pt-6",children:e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-sm text-muted-foreground",children:"Avg AI Score"}),e.jsxs("p",{className:"text-2xl font-bold",children:[u.avgScore,"%"]})]}),e.jsx(M,{className:"h-8 w-8 text-primary opacity-80"})]})})})]}),e.jsx(o,{className:"mb-6",children:e.jsx(x,{className:"pt-6",children:e.jsxs("div",{className:"flex flex-col md:flex-row gap-4",children:[e.jsxs("div",{className:"flex-1 relative",children:[e.jsx(V,{className:"absolute left-3 top-1/2 -translate-y-1/2 h-4 w-4 text-muted-foreground"}),e.jsx(P,{placeholder:"Search by name, email, or position...",value:h,onChange:s=>U(s.target.value),className:"pl-10"})]}),e.jsxs(A,{value:f,onValueChange:E,children:[e.jsxs(k,{className:"w-[180px]",children:[e.jsx(X,{className:"h-4 w-4 mr-2"}),e.jsx(R,{placeholder:"Filter by status"})]}),e.jsxs(D,{children:[e.jsx(r,{value:"all",children:"All Statuses"}),e.jsx(r,{value:"new",children:"New"}),e.jsx(r,{value:"reviewing",children:"Reviewing"}),e.jsx(r,{value:"interviewed",children:"Interviewed"}),e.jsx(r,{value:"hired",children:"Hired"}),e.jsx(r,{value:"rejected",children:"Rejected"})]})]}),e.jsxs(A,{value:g,onValueChange:B,children:[e.jsxs(k,{className:"w-[180px]",children:[e.jsx(O,{className:"h-4 w-4 mr-2"}),e.jsx(R,{placeholder:"Sort by"})]}),e.jsxs(D,{children:[e.jsx(r,{value:"created_at",children:"Date Applied"}),e.jsx(r,{value:"ai_fit_score",children:"AI Fit Score"}),e.jsx(r,{value:"ai_drive_score",children:"Drive Score"})]})]})]})})}),e.jsxs(o,{children:[e.jsx(Q,{children:e.jsxs($,{children:["Applications (",w.length,")"]})}),e.jsx(x,{children:F?e.jsx("div",{className:"space-y-4",children:[1,2,3].map(s=>e.jsx(G,{className:"h-16 w-full"},s))}):w.length===0?e.jsxs("div",{className:"text-center py-12",children:[e.jsx(C,{className:"h-12 w-12 mx-auto text-muted-foreground mb-4"}),e.jsx("p",{className:"text-muted-foreground",children:"No applications foun
1d"})]}):e.jsxs(q,{children:[e.jsx(J,{children:e.jsxs(T,{children:[e.jsx(n,{children:"Candidate"}),e.jsx(n,{children:"Position"}),e.jsx(n,{children:"Fit Score"}),e.jsx(n,{children:e.jsxs("span",{className:"flex items-center gap-1 text-orange-600 dark:text-orange-400",children:[e.jsx(Z,{className:"h-3 w-3"}),"Drive"]})}),e.jsx(n,{children:"Status"}),e.jsx(n,{children:"Applied"}),e.jsx(n,{className:"text-right",children:"Actions"})]})}),e.jsx(K,{children:w.map(s=>e.jsxs(T,{children:[e.jsx(c,{children:e.jsxs("div",{children:[e.jsx("p",{className:"font-medium",children:s.full_name}),e.jsx("p",{className:"text-sm text-muted-foreground",children:s.email})]})}),e.jsx(c,{children:s.position}),e.jsx(c,{children:s.ai_fit_score!==null?e.jsxs(i,{className:te(s.ai_fit_score),children:[s.ai_fit_score,"%"]}):e.jsx(i,{variant:"outline",className:"text-muted-foreground",children:"Pending"})}),e.jsx(c,{children:s.ai_drive_score!==null?e.jsxs(i,{className:"bg-orange-500/20 text-orange-700 dark:text-orange-400",children:[s.ai_drive_score,"%"]}):e.jsx(i,{variant:"outline",className:"text-muted-foreground",children:"-"})}),e.jsx(c,{children:e.jsx(i,{className:re(s.status),children:s.status.charAt(0).toUpperCase()+s.status.slice(1)})}),e.jsx(c,{children:se(new Date(s.created_at),"MMM d, yyyy")}),e.jsx(c,{className:"text-right",children:e.jsxs("div",{className:"flex items-center justify-end gap-2",children:[e.jsx(j,{variant:"ghost",size:"icon",onClick:()=>a(`/admin/applications/${s.id}`),title:"View Details",children:e.jsx(Y,{className:"h-4 w-4"})}),s.resume_path&&e.jsx(j,{variant:"ghost",size:"icon",onClick:()=>I(s.resume_path,s.full_name),title:"Download Resume",children:e.jsx(ee,{className:"h-4 w-4"})})]})})]},s.id))})]})})]})]})})}export{ge 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.