1import{i as c,r as d,u as l,j as e,L as x}from"./index-CMjJqRFh.js";import{g as o}from"./admin.functions-D6Zcv2U7.js";import{f as p}from"./slug-BiNC3iOf.js";const m={api:"ATS-API",jsonld:"JSON-LD",generic:"Generic",ai:"AI-extract",rss:"RSS"},h={api:"bg-emerald-500",jsonld:"bg-sky-500",generic:"bg-zinc-500",ai:"bg-amber-500",rss:"bg-violet-500"};function u(){const r=c(o),[a,t]=d.useState(7),{data:n,isLoading:i}=l({queryKey:["admin","strategy-leaderboard",a],queryFn:()=>r({data:{window_days:a}})});return e.jsxs("div",{className:"space-y-6",children:[e.jsxs("header",{className:"flex items-end justify-between",children:[e.jsxs("div",{children:[e.jsx("h1",{className:"text-2xl font-semibold tracking-tight",children:"Strategi-leaderboard"}),e.jsx("p",{className:"mt-1 text-sm text-zinc-500",children:"Topprankade företag per extraktionsstrategi efter passrate och snitt-confidence."})]}),e.jsx("div",{className:"inline-flex rounded-md border border-zinc-300 bg-white p-0.5",children:[7,30].map(s=>e.jsxs("button",{onClick:()=>t(s),className:`rounded px-3 py-1 text-xs font-medium ${a===s?"bg-zinc-900 text-white":"text-zinc-600 hover:bg-zinc-100"}`,children:["Senaste ",s," dagar"]},s))})]}),i||!n?e.jsx("p",{className:"text-sm text-zinc-500",children:"Laddar leaderboardâ¦"}):e.jsx("div",{className:"grid grid-cols-1 gap-4 xl:grid-cols-2",children:n.per_strategy.map(s=>e.jsx(g,{strategy:s.strategy,top:s.top},s.strategy))})]})}function g({strategy:r,top:a}){return e.jsxs("div",{className:"rounded-lg border border-zinc-200 bg-white p-4",children:[e.jsxs("div",{className:"flex items-center justify-between",children:[e.jsxs("h2",{className:"flex items-center gap-2 text-sm font-bold uppercase tracking-wide text-zinc-700",children:[e.jsx("span",{className:`h-2.5 w-2.5 rounded-full ${h[r]}`}),m[r]]}),e.jsxs("span",{className:"text-xs text-zinc-500",children:[a.length," företag"]})]}),a.length===0?e.jsx("p",{className:"mt-3 text-sm text-zinc-400",children:"Inga körningar i fönstret."}):e.jsxs("table",{className:"mt-3 w-full text-xs",children:[e.jsx("thead",{className:"text-zinc-500",children:e.jsxs("tr",{className:"border-b border-zinc-200",children:[e.jsx("th",{className:"px-1 py-1 text-left font-bold uppercase",children:"#"}),e.jsx("th",{className:"px-1 py-1 text-left font-bold uppercase",children:"Företag"}),e.jsx("th",{className:"px-1 py-1 text-right font-bold uppercase",children:"Pass"}),e.jsx("th",{className:"px-1 py-1 text-right font-bold uppercase",children:"â Conf"}),e.jsx("th",{className:"px-1 py-1 text-right font-bold uppercase",children:"Körn"}),e.jsx("th",{className:"px-1 py-1 text-right font-bold uppercase",children:"â Jobb"}),e.jsx("th",{className:"px-1 py-1 text-right font-bold uppercase",children:"Jobb DB"}),e.jsx("th",{className:"px-1 py-1 text-right font-bold uppercase",children:"Score"})]})}),e.jsx("tbody",{children:a.map((t,n)=>e.jsxs("tr",{className:"border-b border-zinc-100",children:[e.jsx("td",{className:"px-1 py-1.5 font-mono text-zinc-400",children:n+1}),e.jsxs("td",{className:"px-1 py-1.5",children:[e.jsx(x,{to:"/app/targets/$id",params:{id:t.target_id},className:"font-medium text-zinc-900 hover:underline",children:t.company_name}),e.jsxs("div",{className:"font-mono text-[10px] text-zinc-400",children:[t.detected_ats_slug??"â"," · ",t.status??"â"," · ",p(t.last_run)]})]}),e.jsxs("td",{className:"px-1 py-1.5 text-right font-mono",children:[e.jsxs("span",{className:t.pass_rate>=.8?"text-emerald-700":t.pass_rate>=.5?"text-amber-700":"text-red-700",children:[Math.round(t.pass_rate*100),"%"]}),e.jsxs("span",{className:"text-zinc-400",children:[" (",t.passed,"/",t.runs,")"]})]}),e.jsx("td",{className:"px-1 py-1.5 text-right font-mono",children:t.avg_confidence.toFixed(2)}),e.jsx("td",{className:"px-1 py-1.5 text-right font-mono text-zinc-500",children:t.runs}),e.jsx("td",{className:"px-1 py-1.5 text-right font-mono text-zinc-500",children:t.avg_jobs.toFixed(1)}),e.jsxs("td",{className:"px-1 py-1.5 text-right font-mono text-zinc-500",children:[t.jobs_in_db,t.jobs_in_db>0?e.jsxs("span",{className:"text-zinc-400",children:[" @ ",t.jobs_avg_confidence.toFixed(2)]}):null]}),e.jsx("td",{className:"px-1 py-1.5 text-right font-mono font-bold",children:t.score.toFixed(2)})]},t.target_id))})]})]})}export{u as component};
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.