import{t as e}from"./jsx-runtime-B-hcVAMW.js";import{z as t}from"./index-DyQEyT-0.js";import{t as n}from"./Badge-BGqYAYKM.js";var r=e();function i(e){if(e.salary.amount===null||e.salary.currency===null)return null;let t=e.salary.amount/100;return`${new Intl.NumberFormat(void 0,{style:`currency`,currency:e.salary.currency,maximumFractionDigits:0}).format(t)} / ${e.salary.period}`}function a({job:e}){let a=i(e);return(0,r.jsxs)(`article`,{className:`flex flex-col gap-3 rounded-2xl border border-slate-200 bg-white p-5 transition hover:border-brand-300 hover:shadow-sm`,children:[(0,r.jsxs)(`div`,{className:`flex items-start justify-between gap-3`,children:[(0,r.jsxs)(`div`,{className:`min-w-0`,children:[(0,r.jsx)(`h3`,{className:`text-base font-semibold text-slate-900`,children:(0,r.jsx)(t,{to:`/jobs/${e.slug}`,className:`hover:text-brand-700`,children:e.title})}),(0,r.jsxs)(`p`,{className:`mt-0.5 text-sm text-slate-500`,children:[e.country,e.city?` · ${e.city}`:``,e.employer_name?` · ${e.employer_name}`:``]})]}),(0,r.jsxs)(`div`,{className:`flex shrink-0 flex-wrap justify-end gap-1.5`,children:[e.is_urgent&&(0,r.jsx)(n,{tone:`danger`,children:`Urgent`}),e.is_featured&&(0,r.jsx)(n,{tone:`info`,children:`Featured`})]})]}),e.summary&&(0,r.jsx)(`p`,{className:`line-clamp-2 text-sm text-slate-600`,children:e.summary}),(0,r.jsxs)(`dl`,{className:`grid grid-cols-2 gap-x-4 gap-y-2 text-sm sm:grid-cols-3`,children:[(0,r.jsxs)(`div`,{children:[(0,r.jsx)(`dt`,{className:`text-xs text-slate-500`,children:`Vacancies`}),(0,r.jsx)(`dd`,{className:`font-medium text-slate-900`,children:e.vacancies})]}),a&&(0,r.jsxs)(`div`,{children:[(0,r.jsx)(`dt`,{className:`text-xs text-slate-500`,children:`Salary`}),(0,r.jsx)(`dd`,{className:`font-medium text-slate-900`,children:a})]}),e.required_experience_years!==null&&(0,r.jsxs)(`div`,{children:[(0,r.jsx)(`dt`,{className:`text-xs text-slate-500`,children:`Experience`}),(0,r.jsxs)(`dd`,{className:`font-medium text-slate-900`,children:[e.required_experience_years,`+ years`]})]})]}),(0,r.jsxs)(`div`,{className:`mt-auto flex flex-wrap items-center justify-between gap-3 pt-2`,children:[(0,r.jsx)(`p`,{className:`text-xs text-slate-500`,children:e.application_deadline?`Apply before ${e.application_deadline}`:`Open until filled`}),(0,r.jsxs)(`div`,{className:`flex gap-2`,children:[(0,r.jsx)(t,{to:`/jobs/${e.slug}`,className:`rounded-lg px-3 py-2 text-sm text-slate-700 ring-1 ring-slate-300 transition hover:bg-slate-50`,children:`View details`}),e.accepting_applications&&(0,r.jsx)(t,{to:`/register?job=${e.slug}`,className:`rounded-lg bg-brand-600 px-3 py-2 text-sm font-medium text-white transition hover:bg-brand-700`,children:`Apply now`})]})]})]})}export{i as n,a as t};