1import{u as D,r,j as e,O as L,Q as V,W as O,Y as $,bg as A,L as B,b3 as M,b4 as T,b5 as E,B as F,$ as P,G as m,X as R,a3 as q,q as p,an as z,bL as v,ap as w,k as y,H as J,bm as _,bn as C,bo as S,bp as k,ci as H,aY as U,aG as G}from"./index-C1fX6R5K.js";import{C as Y}from"./CompanyPageLoader-DJCvUfg9.js";import{J as Q}from"./JobOfferModal-DqDwjMN0.js";import{F as W}from"./file-up-BPphhTmW.js";import"./i18n-BtccWlCM.js";import"./index-paNpr7jU.js";import"./switch-BdKksvuy.js";import"./trash-CDDqBUo1.js";function X({isOpen:t,onClose:o,jobId:l,jobTitle:b}){const{t:a}=D(),[n,h]=r.useState([]),[j,d]=r.useState(!1),x=async()=>{if(l){d(!0);try{const{data:s}=await p.get(`/api/job-offers/${l}/candidates`);h(s.data||[])}catch(s){console.error("Failed to fetch candidates",s)}finally{d(!1)}}},i=async(s,c)=>{try{await p.put(`/api/job-applications/${s}`,{status:c}),h(f=>f.map(N=>N.id===s?{...N,status:c}:N))}catch(f){console.error("Failed to update status",f)}};r.useEffect(()=>{t&&l&&x()},[t,l]);const u=s=>{switch(s){case"accepted":return"text-green-400 border-green-500/30 bg-green-500/10";case"rejected":return"text-red-400 border-red-500/30 bg-red-500/10";case"more_info":return"text-blue-400 border-blue-500/30 bg-blue-500/10";default:return"text-yellow-500 border-yellow-500/30 bg-yellow-500/10"}},g=s=>{switch(s){case"accepted":return a("candidates.status.accepted",{defaultValue:"Accepted"});case"rejected":return a("candidates.status.rejected",{defaultValue:"Rejected"});case"more_info":return a("candidates.status.more_info",{defaultValue:"More Files Requested"});default:return a("candidates.status.pending",{defaultValue:"Pending"})}};return e.jsx(L,{open:t,onOpenChange:o,children:e.jsxs(V,{className:"sm:max-w-[600px] bg-[#1e1f25] border-white/10 text-white",children:[e.jsx(O,{children:e.jsxs($,{children:[a("creator_pro_dashboard.candidates_for"),' "',b,'"']})}),e.jsx(A,{className:"max-h-[60vh] pr-4",children:j?e.jsx("div",{className:"flex justify-center py-8",children:e.jsx(B,{className:"h-8 w-8 animate-spin text-primary"})}):n.length===0?e.jsx("div",{className:"text-center py-12 text-gray-500",children:e.jsx("p",{children:a("creator_pro_dashboard.no_candidates")})}):e.jsx("div",{className:"space-y-4",children:n.map(s=>e.jsxs("div",{className:"bg-black/20 p-4 rounded-xl border border-white/5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsxs(M,{children:[e.jsx(T,{src:s.user.avatar}),e.jsx(E,{children:s.user.name[0]})]}),e.jsxs("div",{children:[e.jsx("p",{className:"font-bold text-sm",children:s.user.name}),e.jsxs("p",{className:"text-xs text-gray-400",children:["@",s.user.username]})]})]}),e.jsx(F,{variant:"outline",className:u(s.status),children:g(s.status)})]}),s.cover_letter&&e.jsxs("div",{className:"mt-3 bg-white/5 p-3 rounded-lg text-sm text-gray-300",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-1 text-xs text-gray-500 uppercase font-bold",children:[e.jsx(P,{className:"h-3 w-3"}),"Cover Letter"]}),s.cover_letter]}),(s.status==="pending"||s.status==="more_info")&&e.jsxs("div",{className:"flex flex-wrap justify-end gap-2 mt-4",children:[e.jsxs(m,{size:"sm",variant:"ghost",onClick:()=>i(s.id,"rejected"),className:"text-red-400 hover:text-red-300 hover:bg-red-500/10",children:[e.jsx(R,{className:"h-4 w-4 mr-1"}),a("candidates.action.reject",{defaultValue:"Reject"})]}),s.status!=="more_info"&&e.jsxs(m,{size:"sm",variant:"ghost",onClick:()=>i(s.id,"more_info"),className:"text-blue-400 hover:text-blue-300 hover:bg-blue-500/10",children:[e.jsx(W,{className:"h-4 w-4 mr-1"}),a("candidates.action.request_files",{defaultValue:"Request More Files"})]}),e.jsxs(m,{size:"sm",onClick:()=>i(s.id,"accepted"),className:"bg-green-600 hover:bg-green-700 text-white",children:[e.jsx(q,{className:"h-4 w-4 mr-1"}),a("candidates.action.accept",{defaultValue:"Accept"})]})]})]},s.id))})})]})})}function le(){const{t}=D(),[o,l]=r.useState(null),[b,a]=r.useState(!0),[n,h]=r.useState([]),[j,d]=r.useState(!1),[x,i]=r.useState(null),u=async()=>{a(!0);try{const{data:s}=await p.get("/api/company/stats");l(s);const{data:c}=await p.get("/api/job-offers?my=true");h(c.data||[])}catch(s){console.error("Failed to fetch creator pro data:",s)}finally{a(!1)}};r.useEffect(()=>{u()},[]);const g=[{title:t("creator_pro_dashboard.stats.views"),value:o?.visitors||0,icon:z,color:"text-blue-500"},{title:t("creator_pro_dashboard.stats.active_offers"),value:o?.active_offers||0,icon:v,color:"text-green-500"},{title:t("creator_pro_dashboard.stats.candidates"),value:o?.total_candidates||0,icon:w,color:"text-purple-500"}];return b?e.jsx(Y,{}):e.jsxs("div",{className:"max-w-7xl mx-auto px-4 py-8 space-y-8 animate-in fade-in duration-500",children:[e.jsxs("div",{className:"flex flex-col md:flex-row justify-between items-start md:items-center gap-4",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-3xl font-bold text-white",children:t("creator_pro_dashboard.title")}),e.jsx("p",{className:"text-gray-400",children:t("creator_pro_dashboard.subtitle")})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(m,{variant:"outline",className:"border-white/10 text-white hover:bg-white/5",onClick:()=>window.location.href="/creator-pro/bookings",children:[e.jsx(y,{className:"h-4 w-4 mr-2"}),"Bookings"]}),e.jsx(Q,{isOpen:j,onClose:()=>d(!1),onSuccess:u,trigger:e.jsxs(m,{onClick:()=>d(!0),className:"bg-gradient-to-r from-amber-500 to-orange-500 text-white border-0 hover:from-amber-600 hover:to-orange-600",children:[e.jsx(J,{className:"h-4 w-4 mr-2"}),t("creator_pro_dashboard.post_new")]})})]}),e.jsx(X,{isOpen:!!x,onClose:()=>i(null),jobId:x?.id||null,jobTitle:x?.title||""})]}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:g.map((s,c)=>e.jsxs(_,{className:"bg-[#1e1f25] border-white/10 text-white",children:[e.jsxs(C,{className:"flex flex-row items-center justify-between space-y-0 pb-2",children:[e.jsx(S,{className:"text-sm font-medium text-muted-foreground",children:s.title}),e.jsx(s.icon,{className:`h-4 w-4 ${s.color}`})]}),e.jsx(k,{children:e.jsx("div",{className:"text-2xl font-bold",children:s.value})})]},c))}),e.jsxs("div",{className:"space-y-4",children:[e.jsx("h2",{className:"text-xl font-bold text-white",children:t("creator_pro_dashboard.my_offers")}),n.length===0?e.jsxs("div",{className:"text-center py-12 text-muted-foreground bg-[#1e1f25]/50 rounded-xl border border-white/5 border-dashed",children:[e.jsx(v,{className:"h-10 w-10 mx-auto mb-3 opacity-50"}),e.jsx("p",{children:t("creator_pro_dashboard.no_offers")})]}):e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:n.map(s=>e.jsxs(_,{className:"bg-[#1e1f25] border-white/10 text-white flex flex-col group hover:border-primary/50 transition-colors",children:[e.jsxs(C,{className:"pb-3",children:[e.jsxs("div",{className:"flex justify-between items-start",children:[e.jsx(S,{className:"text-lg font-bold line-clamp-1",children:s.title}),e.jsx(F,{variant:s.status==="active"?"default":"secondary",className:s.status==="active"?"bg-green-500/20 text-green-400":"",children:s.status})]}),e.jsxs("div",{className:"text-xs text-gray-500 flex items-center gap-1 mt-1",children:[e.jsx(y,{className:"h-3 w-3"}),e.jsx("span",{children:H(new Date(s.created_at),{addSuffix:!0})})]})]}),e.jsxs(k,{className:"flex-1 text-sm space-y-3 pb-3",children:[e.jsxs("div",{className:"flex items-center gap-2 text-gray-300",children:[e.jsx(U,{className:"h-3.5 w-3.5 text-primary"}),e.jsx("span",{children:s.location||t("job_board.remote")})]}),e.jsxs("div",{className:"flex items-center gap-2 text-gray-300",children:[e.jsx(G,{className:"h-3.5 w-3.5 text-primary"}),e.jsx("span",{children:s.salary_min?`${s.salary_min} - ${s.salary_max}`:t("job_board.negotiable")})]}),e.jsxs("div",{className:"pt-2 border-t border-white/5 flex justify-between items-center text-xs text-gray-400",children:[e.jsxs("button",{onClick:()=>i({id:s.id,title:s.title}),className:"hover:text-primary transition-colors font-medium flex items-center gap-1",children:[e.jsx(w,{className:"h-3.5 w-3.5"}),t("creator_pro_dashboard.candidates_count",{count:s.applications_count||0})]}),e.jsx("span",{className:"capitalize",children:t(`job_board.${s.work_type}`,{defaultValue:s.work_type})})]})]})]},s.id))})]})]})}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.