PageSourceSearch

https://careerlaunch.ai/assets/EmployerProjects-fZ3nrdPn.js

js careerlaunch.ai collected 2026-10-05 11:55:10 UTC 23,273 bytes, 1 lines download raw bytes

1import{s as v,J as be,a as ye,r as l,j as e,a1 as Ne,ao as Re,a2 as we,a3 as Se,a4 as _e,a5 as Ce,l as x,I as S,T as re,p as o,B as H,b0 as Fe,d as le,F as ke,aa as Ue,R as Ie,b as pe,e as he,k as ge,f as qe,h as ze,x as Oe,am as $e,X as Be,E as He,aJ as Ve}from"./index-BIqWDMxQ.js";import{T as We,a as Je,b as X,c as K}from"./tabs-B3xt6REk.js";import{S as Q,a as Z,b as ee,c as se,d as ae}from"./select-B9wxlFZh.js";import{P as ne}from"./plus-B4MPw1Xv.js";import{T as fe}from"./trash-2-bQ7EzArG.js";import{U as Me}from"./upload-jqXEC-hN.js";import{S as Ye}from"./save-LEtsvjLf.js";import{o as Ge,s as te,c as je}from"./types-DeSqVgyU.js";import{D as Xe}from"./dollar-sign-CeZaWspA.js";import{C as Ke}from"./clock-mnW44_Qt.js";import{P as Qe}from"./pencil-BENeT_nE.js";const Ze=[{value:"excel",label:"Excel / spreadsheet",accept:".xlsx,.xls,.csv",hint:".xlsx, .xls or .csv"},{value:"document",label:"Document",accept:".pdf,.doc,.docx,.txt,.md",hint:".pdf, .doc, .docx"},{value:"presentation",label:"Presentation / deck",accept:".ppt,.pptx,.pdf,.key",hint:".ppt, .pptx, .pdf"},{value:"video",label:"Video recording",accept:"video/*",hint:".mp4, .mov, .webm"},{value:"image",label:"Image / design file",accept:"image/*,.fig,.sketch",hint:"png, jpg, design export"},{value:"link",label:"Link (Loom, Figma, repo)",accept:"",hint:"paste a URL"},{value:"text",label:"Written answer",accept:"",hint:"type your response"}],es=["Engineering","Data & Analytics","Product","Design","Sales / GTM","Marketing","Operations","Finance","Research","Other"],ss=[{value:"fixed",label:"Fixed price for the project"},{value:"hourly",label:"Hourly rate"}],as={applied:"Applied",approved:"Approved",declined:"Declined",withdrawn:"Withdrawn",submitted:"Submitted",completed:"Completed"},V=r=>Number(r||0).toLocaleString("en-US",{style:"currency",currency:"USD",maximumFractionDigits:0});function ts(r){if(r.pay_type==="hourly"){const a=r.estimated_hours?` · est. ${V(r.pay_amount*r.estimated_hours)}`:"";return`${V(r.pay_amount)}/hr${a}`}return V(r.pay_amount)}function is(r){return r?r%24===0?`${r/24} day${r/24>1?"s":""} to deliver`:`${r} hour${r>1?"s":""} to deliver`:"No time limit"}function rs(r){return{...r,skills:r.skills??[],deliverables:Array.isArray(r.deliverables)?r.deliverables:[],resources:Array.isArray(r.resources)?r.resources:[],pay_amount:Number(r.pay_amount??0)}}async function ls(r,a,N=3600){const{data:w,error:b}=await v.storage.from(r).createSignedUrl(a,N);if(b)throw b;return w.signedUrl}async function ns(r,a){const N=await ls(r,a);window.open(N,"_blank","noopener,noreferrer")}const ds=Ge({title:te().trim().min(4,"Add a project title").max(140),summary:te().trim().max(240).optional(),description:te().trim().min(30,"Describe the project in at least 30 characters").max(6e3),pay_amount:je.number().min(1,"Set the pay for this project"),seats:je.number().int().min(1).max(50)}),ve=()=>({id:crypto.randomUUID(),label:"",type:"document",instructions:"",required:!0});function ie({trigger:r,project:a,onSaved:N}){var ue,xe;const{user:w,profile:b}=be(),{toast:k}=ye(),[E,A]=l.useState(!1),[L,R]=l.useState(!1),[_,C]=l.useState(!1),[p,D]=l.useState({}),[F,U]=l.useState((a==null?void 0:a.title)??""),[h,W]=l.useState((a==null?void 0:a.summary)??""),[I,q]=l.useState((a==null?void 0:a.description)??""),[T,J]=l.useState((a==null?void 0:a.category)??"Engineering"),[t,c]=l.useState(((a==null?void 0:a.skills)??[]).join(", ")),[d,f]=l.useState((a==null?void 0:a.pay_type)??"fixed"),[u,i]=l.useState(String((a==null?void 0:a.pay_amount)??"")),[g,y]=l.useState(String((a==null?void 0:a.estimated_hours)??"")),[z,De]=l.useState(String((a==null?void 0:a.time_limit_hours)??"72")),[M,Te]=l.useState(((ue=a==null?void 0:a.application_deadline)==null?void 0:ue.slice(0,10))??""),[de,Pe]=l.useState(String((a==null?void 0:a.seats)??1)),[ce,Y]=l.useState((xe=a==null?void 0:a.deliverables)!=null&&xe.length?a.deliverables:[ve()]),[G,oe]=l.useState((a==null?void 0:a.resources)??[]),$=(s,m)=>Y(n=>n.map(j=>j.id===s?{...j,...m}:j)),Ee=async s=>{if(!(!(s!=null&&s.length)||!w)){C(!0);try{const m=[];for(const n of Array.from(s)){const j=`${w.id}/${Date.now()}-${n.name.replace(/[^\w.\-]/g,"_")}`,{error:O}=await v.storage.from("project-resources").upload(j,n);if(O)throw O;m.push({name:n.name,path:j,size:n.size})}oe(n=>[...n,...m])}catch(m){k({title:"Upload failed",description:m.message,variant:"destructive"})}finally{C(!1)}}},me=async s=>{if(!w)return;const m=ds.safeParse({title:F,summary:h,description:I,pay_amount:u,seats:de});if(!m.success){const P={};
1Object.entries(m.error.flatten().fieldErrors).forEach(([Le,B])=>{B!=null&&B[0]&&(P[Le]=B[0])}),D(P);return}const n=ce.filter(P=>P.label.trim());if(s==="open"&&n.length===0){k({title:"Add at least one deliverable",description:"Candidates need to know what to submit.",variant:"destructive"});return}D({}),R(!0);const j={employer_user_id:w.id,company_name:(b==null?void 0:b.company_name)??null,title:m.data.title,summary:h.trim()||null,description:m.data.description,category:T,skills:t.split(",").map(P=>P.trim()).filter(Boolean),pay_amount:m.data.pay_amount,pay_type:d,estimated_hours:g?Number(g):null,time_limit_hours:z?Number(z):null,application_deadline:M?new Date(M).toISOString():null,seats:m.data.seats,deliverables:n,resources:G,status:s},{error:O}=a?await v.from("employer_projects").update(j).eq("id",a.id):await v.from("employer_projects").insert(j);if(R(!1),O){k({title:"Could not save project",description:O.message,variant:"destructive"});return}k({title:s==="open"?"Project published":"Draft saved",description:s==="open"?"Candidates can now browse and opt in.":"Publish it when you're ready."}),A(!1),N==null||N()},Ae=d==="hourly"&&g?Number(u||0)*Number(g):Number(u||0);return e.jsxs(Ne,{open:E,onOpenChange:A,children:[e.jsx(Re,{asChild:!0,children:r}),e.jsxs(we,{className:"max-w-3xl max-h-[92vh] overflow-y-auto",children:[e.jsxs(Se,{children:[e.jsx(_e,{children:a?"Edit project":"Request a project"}),e.jsx(Ce,{children:"Define the work, the pay, what must be delivered, and how long they have. Candidates browse it and opt in — you approve who gets it."})]}),e.jsxs("div",{className:"space-y-6",children:[e.jsxs("section",{className:"space-y-4",children:[e.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-primary/10 text-[11px] font-bold text-primary",children:"1"}),"The project"]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(x,{htmlFor:"p-title",children:"Project title"}),e.jsx(S,{id:"p-title",value:F,onChange:s=>U(s.target.value),maxLength:140,placeholder:"e.g. Build a 3-year SaaS revenue model in Excel"}),p.title&&e.jsx("p",{className:"text-xs text-destructive",children:p.title})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(x,{htmlFor:"p-summary",children:"One-line summary"}),e.jsx(S,{id:"p-summary",value:h,onChange:s=>W(s.target.value),maxLength:240,placeholder:"Shown on the project card in the browse feed"})]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(x,{children:"Category"}),e.jsxs(Q,{value:T,onValueChange:J,children:[e.jsx(Z,{children:e.jsx(ee,{})}),e.jsx(se,{children:es.map(s=>e.jsx(ae,{value:s,children:s},s))})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(x,{htmlFor:"p-skills",children:"Skills (comma separated)"}),e.jsx(S,{id:"p-skills",value:t,onChange:s=>c(s.target.value),placeholder:"Excel, financial modeling, SaaS"})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(x,{htmlFor:"p-desc",children:"Full brief & instructions"}),e.jsx(re,{id:"p-desc",rows:6,value:I,onChange:s=>q(s.target.value),maxLength:6e3,placeholder:"Context, the exact task, what good looks like, data sources, formatting rules, and how you'll evaluate the work."}),p.description&&e.jsx("p",{className:"text-xs text-destructive",children:p.description})]})]}),e.jsxs("section",{className:"space-y-4 border-t border-border pt-5",children:[e.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-primary/10 text-[11px] font-bold text-primary",children:"2"}),"Pay & timing"]}),e.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(x,{children:"Pay structure"}),e.jsxs(Q,{value:d,onValueChange:f,children:[e.jsx(Z,{children:e.jsx(ee,{})}),e.jsx(se,{children:ss.map(s=>e.jsx(ae,{value:s.value,children:s.label},s.value))})]})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(x,{htmlFor:"p-pay",children:d==="hourly"?"Hourly rate (USD)":"Project pay (USD)"}),e.jsx(S,{id:"p-pay",type:"number",min:1,value:u,onChange:s=>i(s.target.value),placeholder:"750"}),p.pay_amount&&e.jsx("p",{className:"text-xs text-destructive",children:p.pay_amount})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(x,{htmlFor:"p-hours",children:"Estimated hours of work"}),e.jsx(S,{id:"p-hours",type:"number",min:1,value:g,onChange:s=>y(s.target.value),placeholder:"10"})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(x,{htmlFor:"p-limit",children:"Time limit once approved (hours)"}),e.jsx(S,{id:"p-limit",type:"number",min:1,value:z,onChange:s=>De(s.target.value),placeholder:"72"}),e.jsx("p",{className:"text-[11px] text-muted-foreground",children:"Their countdown starts the moment you approve them."})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(x,{htmlFor:"p-deadline",children:"Applications close"}),e.jsx(S,{id:"p-deadline",type:"date",value:M,onChange:s=>Te(s.target.value)})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(x,{htmlFor:"p-seats",children:"How many people can be approved"}),e.jsx(S,{id:"p-seats",type:"number",min:1,max:50,value:de,onChange:s=>Pe(s.target.value)})]})]}),e.jsxs("div",{className:"rounded-lg border border-border bg-muted/40 px-3 py-2 text-sm flex items-center justify-between",children:[e.jsx("span",{className:"text-muted-foreground",children:"Budget per approved person"}),e.jsx("span",{className:"font-bold",children:V(Ae)})]})]}),e.jsxs("section",{className:"space-y-3 border-t border-border pt-5",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-primary/10 text-[11px] font-bold text-primary",children:"3"}),"What must be delivered"]}),e.jsxs(o,{type:"button",variant:"outline",size:"sm",onClick:()=>Y(s=>[...s,ve()]),children:[e.jsx(ne,{className:"h-3.5 w-3.5 mr-1"})," Add deliverable"]})]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Each row becomes a required upload slot in the candidate's submission form."}),e.jsx("div",{className:"space-y-3",children:ce.map((s,m)=>e.jsxs("div",{className:"rounded-lg border border-border p-3 space-y-3",children:[e.jsxs("div",{className:"flex items-start gap-2",children:[e.jsx(H,{variant:"secondary",className:"mt-2",children:m+1}),e.jsxs("div",{className:"flex-1 grid gap-3 sm:grid-cols-2",children:[e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(x,{className:"text-xs",children:"Deliverable name"}),e.jsx(S,{value:s.label,onChange:n=>$(s.id,{label:n.target.value}),placeholder:"e.g. Completed model (.xlsx)",maxLength:120})]}),e.jsxs("div",{className:"space-y-1.5",children:[e.jsx(x,{className:"text-xs",children:"File type"}),e.jsxs(Q,{value:s.type,onValueChange:n=>$(s.id,{type:n}),children:[e.jsx(Z,{children:e.jsx(ee,{})}),e.jsx(se,{children:Ze.map(n=>e.jsx(ae,{value:n.value,children:n.label},n.value))})]})]})]}),e.jsx(o,{type:"button",variant:"ghost",size:"icon",className:"mt-6",onClick:()=>Y(n=>n.filter(j=>
1j.id!==s.id)),children:e.jsx(fe,{className:"h-4 w-4 text-muted-foreground"})})]}),e.jsx(re,{rows:2,value:s.instructions??"",onChange:n=>$(s.id,{instructions:n.target.value}),placeholder:"Exactly what you need to see in this file — tabs, sections, length, format.",maxLength:800}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(Fe,{checked:s.required,onCheckedChange:n=>$(s.id,{required:n})}),e.jsx("span",{className:"text-xs text-muted-foreground",children:"Required to submit"})]})]},s.id))})]}),e.jsxs("section",{className:"space-y-3 border-t border-border pt-5",children:[e.jsxs("h3",{className:"text-sm font-semibold flex items-center gap-2",children:[e.jsx("span",{className:"flex h-5 w-5 items-center justify-center rounded-full bg-primary/10 text-[11px] font-bold text-primary",children:"4"}),"Resources you provide"]}),e.jsx("p",{className:"text-xs text-muted-foreground",children:"Templates, datasets, brand guides, briefs — approved candidates can download these."}),e.jsxs("label",{className:"flex items-center justify-center gap-2 rounded-lg border-2 border-dashed border-border px-4 py-6 text-sm cursor-pointer hover:border-primary/50 hover:bg-primary/5 transition-colors",children:[_?e.jsx(le,{className:"h-4 w-4 animate-spin"}):e.jsx(Me,{className:"h-4 w-4 text-primary"}),e.jsx("span",{className:"text-muted-foreground",children:_?"Uploading…":"Click to upload resource files"}),e.jsx("input",{type:"file",multiple:!0,className:"hidden",onChange:s=>Ee(s.target.files)})]}),G.length>0&&e.jsx("div",{className:"space-y-2",children:G.map(s=>e.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-border px-3 py-2 text-sm",children:[e.jsx(ke,{className:"h-4 w-4 text-muted-foreground shrink-0"}),e.jsx("span",{className:"flex-1 truncate",children:s.name}),e.jsx(o,{type:"button",variant:"ghost",size:"icon",onClick:()=>oe(m=>m.filter(n=>n.path!==s.path)),children:e.jsx(fe,{className:"h-4 w-4 text-muted-foreground"})})]},s.path))})]})]}),e.jsxs(Ue,{className:"gap-2",children:[e.jsxs(o,{variant:"outline",onClick:()=>me("draft"),disabled:L,children:[e.jsx(Ye,{className:"h-4 w-4 mr-2"})," Save draft"]}),e.jsxs(o,{onClick:()=>me("open"),disabled:L,children:[L?e.jsx(le,{className:"h-4 w-4 mr-2 animate-spin"}):e.jsx(Ie,{className:"h-4 w-4 mr-2"}),"Publish project"]})]})]})]})}function bs(){const{user:r}=be(),{toast:a}=ye(),[N,w]=l.useState(!0),[b,k]=l.useState([]),[E,A]=l.useState([]),[L,R]=l.useState([]);l.useState(null);const[_,C]=l.useState(null),[p,D]=l.useState(null),[F,U]=l.useState(""),h=l.useCallback(async()=>{if(!r)return;w(!0);const{data:t}=await v.from("employer_projects").select("*").eq("employer_user_id",r.id).order("created_at",{ascending:!1}),c=(t??[]).map(rs);k(c);const d=c.map(f=>f.id);if(d.length){const[{data:f},{data:u}]=await Promise.all([v.from("project_applications").select("*").in("project_id",d).order("created_at",{ascending:!1}),v.from("project_submissions").select("*").in("project_id",d).order("submitted_at",{ascending:!1})]);A(f??[]),R(u??[])}else A([]),R([]);w(!1)},[r]);l.useEffect(()=>{h()},[h]);const W=l.useMemo(()=>{const t={};return E.forEach(c=>{var d;(t[d=c.project_id]||(t[d]=[])).push(c)}),t},[E]),I=async(t,c)=>{const d=b.find(i=>i.id===t.project_id);C(t.id);const f=c==="approved"&&(d!=null&&d.time_limit_hours)?new Date(Date.now()+d.time_limit_hours*3600*1e3).toISOString():null,{error:u}=await v.from("project_applications").update({status:c,approved_at:c==="approved"?new Date().toISOString():null,due_at:f}).eq("id",t.id);if(C(null),u){a({title:"Update failed",description:u.message,variant:"destructive"});return}a({title:c==="approved"?"Approved":"Declined",description:c==="approved"?`${t.full_name||"Candidate"} now has access to the brief and resources.`:"The applicant has been declined."}),h()},q=async(t,c)=>{await v.from("employer_projects").update({status:c}).eq("id",t.id),h()},T=async t=>{p&&(C(p.id),await v.from("project_submissions").update({review_status:t,reviewer_feedback:F||null}).eq("id",p.id),t==="approved"&&await v.from("project_applications").update({status:"completed"}).eq("id",p.application_id),C(null),D(null),U(""),h())},J={open:"bg-emerald-500/15 text-emerald-600 border-emerald-500/30",draft:"bg-muted text-muted-foreground",filled:"bg-blue-500/15 text-blue-600 border-blue-500/30",closed:"bg-muted text-muted-foreground"};return e.jsxs("div",{className:"p-4 sm:p-6 space-y-5 max-w-6xl mx-auto",children:[e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{children:[e.jsxs("h1",{className:"text-2xl font-bold flex items-center gap-2",children:[e.jsx(pe,{className:"h-6 w-6 text-primary"})," Projects"]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:"Post paid projects and work trials. Candidates browse, opt in, and 
1you approve who gets it."})]}),e.jsx(ie,{trigger:e.jsxs(o,{children:[e.jsx(ne,{className:"h-4 w-4 mr-2"})," Request a project"]}),onSaved:h})]}),N?e.jsx("div",{className:"flex items-center justify-center py-20 text-muted-foreground",children:e.jsx(le,{className:"h-6 w-6 animate-spin"})}):b.length===0?e.jsx(he,{children:e.jsxs(ge,{className:"py-14 text-center space-y-3",children:[e.jsx(pe,{className:"h-10 w-10 mx-auto text-muted-foreground"}),e.jsx("p",{className:"font-medium",children:"No projects yet"}),e.jsx("p",{className:"text-sm text-muted-foreground max-w-md mx-auto",children:"Describe the work, set the pay, list the exact files you need back and a time limit. We surface it to matched candidates instantly."}),e.jsx(ie,{trigger:e.jsxs(o,{children:[e.jsx(ne,{className:"h-4 w-4 mr-2"})," Request your first project"]}),onSaved:h})]})}):e.jsx("div",{className:"grid gap-4",children:b.map(t=>{const c=W[t.id]??[],d=c.filter(i=>["approved","submitted","completed"].includes(i.status)),f=c.filter(i=>i.status==="applied"),u=L.filter(i=>i.project_id===t.id);return e.jsxs(he,{children:[e.jsx(qe,{className:"pb-3",children:e.jsxs("div",{className:"flex flex-wrap items-start justify-between gap-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsxs(ze,{className:"text-base flex items-center gap-2 flex-wrap",children:[t.title,e.jsx(H,{variant:"outline",className:J[t.status],children:t.status})]}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1",children:t.summary||t.category}),e.jsxs("div",{className:"flex flex-wrap gap-3 mt-2 text-xs text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Xe,{className:"h-3.5 w-3.5"}),ts(t)]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Ke,{className:"h-3.5 w-3.5"}),is(t.time_limit_hours)]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(Oe,{className:"h-3.5 w-3.5"}),d.length,"/",t.seats," approved"]}),e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(ke,{className:"h-3.5 w-3.5"}),t.deliverables.length," deliverables"]})]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx(ie,{project:t,trigger:e.jsxs(o,{variant:"outline",size:"sm",children:[e.jsx(Qe,{className:"h-3.5 w-3.5 mr-1.5"})," Edit"]}),onSaved:h}),t.status==="draft"&&e.jsx(o,{size:"sm",onClick:()=>q(t,"open"),children:"Publish"}),t.status==="open"&&e.jsx(o,{variant:"outline",size:"sm",onClick:()=>q(t,"closed"),children:"Close"}),t.status==="closed"&&e.jsx(o,{variant:"outline",size:"sm",onClick:()=>q(t,"open"),children:"Reopen"})]})]})}),e.jsx(ge,{children:e.jsxs(We,{defaultValue:"applicants",children:[e.jsxs(Je,{children:[e.jsxs(X,{value:"applicants",children:["Applicants (",f.length,")"]}),e.jsxs(X,{value:"working",children:["Working (",d.length,")"]}),e.jsxs(X,{value:"submissions",children:["Submissions (",u.length,")"]})]}),e.jsxs(K,{value:"applicants",className:"pt-3 space-y-2",children:[f.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"No new opt-ins yet."}),f.map(i=>e.jsxs("div",{className:"rounded-lg border border-border p-3 space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"font-medium text-sm truncate",children:i.full_name||i.email||"Candidate"}),e.jsx("p",{className:"text-xs text-muted-foreground truncate",children:i.email})]}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(o,{size:"sm",disabled:_===i.id||d.length>=t.seats,onClick:()=>I(i,"approved"),children:[e.jsx($e,{className:"h-3.5 w-3.5 mr-1.5"})," Approve"]}),e.jsxs(o,{size:"sm",variant:"outline",disabled:_===i.id,onClick:()=>I(i,"declined"),children:[e.jsx(Be,{className:"h-3.5 w-3.5 mr-1.5"})," Decline"]})]})]}),i.pitch&&e.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-wrap",children:i.pitch})]},i.id))]}),e.jsxs(K,{value:"working",className:"pt-3 space-y-2",children:[d.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"Nobody approved yet."}),d.map(i=>e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 rounded-lg border border-border p-3",children:[e.jsxs("div",{className:"min-w-0",children:[e.jsx("p",{className:"font-medium text-sm truncate",children:i.full_name||i.email}),e.jsx("p",{className:"text-xs text-muted-foreground",children:i.due_at?`Due ${new Date(i.due_at).toLocaleStr
1ing()}`:"No deadline set"})]}),e.jsx(H,{variant:"secondary",children:as[i.status]??i.status})]},i.id))]}),e.jsxs(K,{value:"submissions",className:"pt-3 space-y-2",children:[u.length===0&&e.jsx("p",{className:"text-sm text-muted-foreground",children:"No deliverables submitted yet."}),u.map(i=>{const g=E.find(y=>y.id===i.application_id);return e.jsxs("div",{className:"rounded-lg border border-border p-3 space-y-2",children:[e.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[e.jsxs("div",{children:[e.jsx("p",{className:"font-medium text-sm",children:(g==null?void 0:g.full_name)||(g==null?void 0:g.email)||"Candidate"}),e.jsxs("p",{className:"text-xs text-muted-foreground",children:["Submitted ",new Date(i.submitted_at).toLocaleString()]})]}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(H,{variant:"outline",children:i.review_status}),e.jsx(o,{size:"sm",variant:"outline",onClick:()=>{D(i),U(i.reviewer_feedback??"")},children:"Review"})]})]}),e.jsx("div",{className:"flex flex-wrap gap-2",children:(i.files??[]).map((y,z)=>e.jsxs(o,{size:"sm",variant:"ghost",className:"h-7 text-xs",onClick:()=>y.path?ns("project-deliverables",y.path):window.open(y.url,"_blank"),children:[y.path?e.jsx(He,{className:"h-3 w-3 mr-1"}):e.jsx(Ve,{className:"h-3 w-3 mr-1"}),y.label||y.name]},z))}),i.notes&&e.jsx("p",{className:"text-sm text-muted-foreground whitespace-pre-wrap",children:i.notes})]},i.id)})]})]})})]},t.id)})}),e.jsx(Ne,{open:!!p,onOpenChange:t=>!t&&D(null),children:e.jsxs(we,{children:[e.jsxs(Se,{children:[e.jsx(_e,{children:"Review submission"}),e.jsx(Ce,{children:"Leave feedback and mark the outcome."})]}),e.jsx(re,{rows:4,value:F,onChange:t=>U(t.target.value),placeholder:"What worked, what to fix.",maxLength:2e3}),e.jsxs("div",{className:"flex flex-wrap gap-2 justify-end",children:[e.jsx(o,{variant:"outline",onClick:()=>T("revisions"),disabled:!!_,children:"Request revisions"}),e.jsx(o,{variant:"outline",onClick:()=>T("rejected"),disabled:!!_,children:"Reject"}),e.jsx(o,{onClick:()=>T("approved"),disabled:!!_,children:"Approve & complete"})]})]})})]})}export{bs 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.