PageSourceSearch

https://labs.cybe.global/assets/AwardsAdmin-INCDTLPJ.js

js cybe.global collected 2026-10-06 07:16:53 UTC 2,537 bytes, 1 lines download raw bytes

1import{r as a,$ as n,j as t,a0 as S}from"./index-XQcRiVCr.js";import{u as N}from"./useAdminResource-epNVZHPT.js";import{A as v}from"./AdminTable-BHXIRhYm.js";const k=["submitted","shortlisted","not_selected","winner"];function L(){const u=a.useCallback(()=>n.list(),[]),{items:p,loading:h,load:b,toast:l,showToast:i}=N(u),[r,d]=a.useState(!0),[c,m]=a.useState(""),[g,w]=a.useState(!1);a.useEffect(()=>{n.getSettings().then(e=>{d(e.nominations_open),m(e.deadline),w(!0)})},[]);const j=async()=>{await n.updateSettings(r,c),i("Settings saved")},f=async(e,s)=>{await n.setStatus(e,s),i("Status updated"),b()},y=async()=>{const s=await(await fetch(n.exportUrl(),{headers:{Authorization:`Bearer ${S()??""}`}})).blob(),x=URL.createObjectURL(s),o=document.createElement("a");o.href=x,o.download="award-nominations.csv",o.click(),URL.revokeObjectURL(x)};return t.jsxs("div",{className:"space-y-6",children:[t.jsxs("div",{className:"flex items-center justify-between",children:[t.jsx("h1",{className:"text-xl font-bold text-white",children:"Award Nominations"}),t.jsx("button",{onClick:y,className:"rounded-lg bg-slate-800 px-4 py-2 text-white text-sm",children:"Export CSV"})]}),t.jsxs("div",{className:"bg-white rounded-xl shadow p-4 flex flex-wrap items-end gap-4",children:[t.jsxs("label",{className:"flex items-center gap-2 text-sm text-slate-700",children:[t.jsx("input",{type:"checkbox",checked:r,onChange:e=>d(e.target.checked),disabled:!g}),"Nominations open"]}),t.jsxs("div",{children:[t.jsx("label",{className:"block text-xs text-slate-500 mb-1",children:"Deadline"}),t.jsx("input",{type:"date",value:c,onChange:e=>m(e.target.value),className:"rounded-lg border border-slate-300 px-2 py-1 text-sm"})]}),t.jsx("button",{onClick:j,className:"rounded-lg bg-emerald-600 px-4 py-2 text-white text-sm",children:"Save settings"})]}),t.jsx(v,{columns:[{label:"Nominee",render:e=>t.jsx("span",{className:"font-medium text-white",children:e.full_name})},{label:"Company",render:e=>e.company,hideOnMobile:!0},{label:"Category",render:e=>e.category},{label:"Nominator",render:e=>e.nominator_email,hideOnMobile:!0},{label:"Status",render:e=>t.jsx("select",{value:e.status,onChange:s=>f(e.id,s.target.value),className:"rounded border border-slate-300 px-2 py-1 text-sm",children:k.map(s=>t.jsx("option",{value:s,children:s},s))})}],rows:p,loading:h,keyExtractor:e=>e.id,emptyMessage:"No nominations yet."}),l&&t.jsx("div",{className:"fixed bottom-4 right-4 bg-slate-900 text-white px-4 py-2 rounded-lg text-sm",children:l})]})}export{L 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.