1import{r as m,a7 as x,j as e,bP as p,aN as h,a4 as b,di as u,bT as g,aQ as j,bS as f}from"./vendor-Bzh17y1V.js";import{C as i,a as n,S as t,c as N,B as v}from"./chunk-admin-BtrU4a8O.js";const y=[{value:"all",label:"All"},{value:"job",label:"Jobs"},{value:"internship",label:"Internships"},{value:"learnership",label:"Learnerships"},{value:"graduate_programme",label:"Graduate Programmes"},{value:"bursary",label:"Bursaries"}],k={job:"bg-blue-100 text-blue-800 border-blue-200 dark:bg-blue-900/30 dark:text-blue-300 dark:border-blue-700",internship:"bg-purple-100 text-purple-800 border-purple-200 dark:bg-purple-900/30 dark:text-purple-300 dark:border-purple-700",learnership:"bg-amber-100 text-amber-800 border-amber-200 dark:bg-amber-900/30 dark:text-amber-300 dark:border-amber-700",graduate_programme:"bg-emerald-100 text-emerald-800 border-emerald-200 dark:bg-emerald-900/30 dark:text-emerald-300 dark:border-emerald-700",bursary:"bg-rose-100 text-rose-800 border-rose-200 dark:bg-rose-900/30 dark:text-rose-300 dark:border-rose-700"},w={job:"Job",internship:"Internship",learnership:"Learnership",graduate_programme:"Graduate Programme",bursary:"Bursary"};function S(a){if(!a)return"https://codematch.co.za";try{const s=new URL(a);if(s.protocol==="https:"||s.protocol==="http:")return a}catch{}return"https://codematch.co.za"}function A({opportunity:a}){const s=S(a.applicationUrl),l=k[a.opportunityType]||"";return e.jsx(i,{className:"flex flex-col transition-shadow hover:shadow-md","data-testid":`card-opportunity-${a.id}`,children:e.jsxs(n,{className:"flex flex-col gap-3 p-5",children:[e.jsxs("div",{className:"flex items-start justify-between gap-2",children:[e.jsx(N,{variant:"outline",className:`text-xs font-medium ${l}`,"data-testid":`badge-type-${a.id}`,children:w[a.opportunityType]}),a.applicationDeadline&&e.jsxs("div",{className:"flex items-center gap-1 text-xs text-muted-foreground shrink-0",children:[e.jsx(b,{className:"h-3 w-3"}),e.jsx("span",{children:a.applicationDeadline})]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-base leading-snug","data-testid":`text-title-${a.id}`,children:a.title}),e.jsxs("p",{className:"text-sm text-muted-foreground mt-0.5","data-testid":`text-employer-${a.id}`,children:[a.employerName,a.department&&` · ${a.department}`]})]}),e.jsxs("div",{className:"flex flex-wrap gap-x-4 gap-y-1 text-xs text-muted-foreground",children:[e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(u,{className:"h-3.5 w-3.5 shrink-0"}),e.jsx("span",{"data-testid":`text-location-${a.id}`,children:a.isRemote?"Remote":a.location})]}),a.minAps!==null&&a.minAps>0&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(g,{className:"h-3.5 w-3.5 shrink-0"}),e.jsxs("span",{children:["Min APS: ",a.minAps]})]}),a.duration&&e.jsxs("div",{className:"flex items-center gap-1",children:[e.jsx(j,{className:"h-3.5 w-3.5 shrink-0"}),e.jsx("span",{children:a.duration})]})]}),e.jsx("a",{href:s,target:"_blank",rel:"noopener noreferrer",className:"mt-auto","data-testid":`link-apply-${a.id}`,children:e.jsxs(v,{className:"w-full gap-2",size:"sm",children:[e.jsx(f,{className:"h-3.5 w-3.5"}),"Apply Now"]})})]})})}function E(){return e.jsx(i,{children:e.jsxs(n,{className:"p-5 space-y-3",children:[e.jsx(t,{className:"h-5 w-28"}),e.jsx(t,{className:"h-5 w-3/4"}),e.jsx(t,{className:"h-4 w-1/2"}),e.jsx(t,{className:"h-4 w-full"}),e.jsx(t,{className:"h-9 w-full"})]})})}function B(){const[a,s]=m.useState("all"),{data:l,isLoading:o}=x({queryKey:["/api/opportunities"]}),d=l?.filter(r=>a==="all"||r.opportunityType===a)??[];return e.jsx("div",{className:"min-h-screen bg-background",children:e.jsxs("div",{className:"container max-w-6xl mx-auto px-4 py-8 space-y-8",children:[e.jsx("div",{className:"rounded-2xl bg-gradient-to-br from-primary/10 via-primary/5 to-transparent border border-primary/10 p-8",children:e.jsx("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:e.jsxs("div",{children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[e.jsx(p,{className:"h-6 w-6 text-primary"}),e.jsx("h1",{className:"text-2xl font-bold",children:"Graduate Opportunities"})]}),e.jsx("p",{className:"text-muted-foreground max-w-xl",children:"Browse internships, learnerships, graduate programmes, jobs and bursaries from South African employers. Apply directly on the employer'
1s website."})]})})}),e.jsx("div",{className:"flex flex-wrap gap-2","data-testid":"filter-bar",children:y.map(r=>e.jsx("button",{onClick:()=>s(r.value),className:["px-4 py-1.5 rounded-full text-sm font-medium border transition-all",a===r.value?"bg-primary text-primary-foreground border-primary":"bg-background border-border text-foreground hover:border-primary/50"].join(" "),"data-testid":`filter-${r.value}`,children:r.label},r.value))}),o?e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:Array.from({length:6}).map((r,c)=>e.jsx(E,{},c))}):d.length===0?e.jsxs("div",{className:"rounded-xl border border-dashed border-border p-12 text-center space-y-4",children:[e.jsx(h,{className:"h-12 w-12 mx-auto text-muted-foreground opacity-40"}),e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-lg mb-1",children:"No opportunities yet"}),e.jsx("p",{className:"text-muted-foreground text-sm max-w-sm mx-auto",children:a==="all"?"Employer partners haven't posted any opportunities yet. Check back soon.":"No opportunities match this filter right now. Try another category."})]})]}):e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:d.map(r=>e.jsx(A,{opportunity:r},r.id))})]})})}export{B 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.