PageSourceSearch

https://scrollstop.com/assets/admin.handovers-CaTRRB7w.js

js scrollstop.com collected 2026-10-04 00:20:12 UTC 4,173 bytes, 1 lines download raw bytes

1import{c as f,r as i,j as t,L as b,s as p}from"./index-CGBybkJ3.js";import{u as N}from"./useQuery-aZU665Zd.js";import{S as j}from"./search-BR-syJb7.js";import{L as v}from"./loader-circle-BQ5RT6XG.js";const _=[["path",{d:"M10.5 22H6a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.706.706l3.588 3.588A2.4 2.4 0 0 1 20 8v6",key:"g5mvt7"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"m14 20 2 2 4-4",key:"15kota"}]],k=f("file-check-corner",_),y=[{k:"all",l:"All"},{k:"complete",l:"Confirmed"},{k:"draft",l:"Draft"},{k:"none",l:"Not started"}];function S(){const[r,x]=i.useState("all"),[o,h]=i.useState(""),{data:l,isLoading:u,error:c}=N({queryKey:["admin_handovers_list"],queryFn:async()=>{const[{data:e,error:s},{data:w,error:m}]=await Promise.all([p.from("pricing_quotes").select("id,person_name,company_name,email_domain,signed_at").not("signed_at","is",null).order("signed_at",{ascending:!1}),p.from("quote_handovers").select("quote_id,status,completeness,updated_at")]);if(s)throw s;if(m)throw m;const g=new Map((w??[]).map(a=>[a.quote_id,a]));return(e??[]).map(a=>{const n=g.get(a.id);return{quoteId:a.id,name:a.person_name,company:a.company_name||a.email_domain,signedAt:a.signed_at,status:n?n.status:"none",completeness:n?n.completeness:null,updatedAt:n?.updated_at??null}})}}),d=i.useMemo(()=>{const e=o.trim().toLowerCase();return(l??[]).filter(s=>(r==="all"||s.status===r)&&(!e||`${s.company} ${s.name}`.toLowerCase().includes(e)))},[l,r,o]);return t.jsxs("div",{className:"p-6 md:p-10 max-w-5xl",children:[t.jsxs("header",{className:"mb-8",children:[t.jsx("p",{className:"text-xs font-bold uppercase tracking-widest text-accent-cyan mb-2",children:"Post-contract"}),t.jsx("h1",{className:"text-3xl font-black tracking-tight",children:"Handovers"}),t.jsx("p",{className:"text-sm text-white/60 mt-2",children:"Every signed contract and its handover pack for the activation team."})]}),t.jsxs("div",{className:"flex flex-wrap items-center gap-2 mb-6",children:[y.map(e=>t.jsx("button",{onClick:()=>x(e.k),className:`px-4 py-2 rounded-pill text-xs font-bold transition-colors ${r===e.k?"bg-accent-cyan text-brand-black":"bg-white/5 text-white/70 hover:text-white"}`,children:e.l},e.k)),t.jsxs("label",{className:"ml-auto flex items-center gap-2 bg-white/5 border border-white/10 rounded-pill px-4 py-2 min-w-0 flex-[0_1_18rem]",children:[t.jsx(j,{className:"w-4 h-4 text-white/40 shrink-0"}),t.jsx("input",{value:o,onChange:e=>h(e.target.value),placeholder:"Search brand or contact",className:"bg-transparent outline-none text-sm min-w-0 w-full"})]})]}),u?t.jsxs("div",{className:"flex items-center gap-2 text-white/50 text-sm",children:[t.jsx(v,{className:"w-4 h-4 animate-spin"})," Loading handovers"]}):c?t.jsx("p",{className:"text-sm text-accent-pink",children:c.message}):d.length===0?t.jsxs("div",{className:"rounded-card border border-white/10 p-10 text-center",children:[t.jsx(k,{className:"w-6 h-6 mx-auto mb-3 text-white/30"}),t.jsx("p",{className:"text-sm text-white/60",children:"No handovers match. They appear here once a contract is signed."})]}):t.jsx("div",{className:"space-y-3",children:d.map(e=>t.jsxs(b,{to:"/admin/handover/$id",params:{id:e.quoteId}
1,className:"flex flex-wrap items-center gap-4 rounded-card border border-white/10 bg-white/[0.03] hover:bg-white/[0.06] px-5 py-4 transition-colors",children:[t.jsxs("div",{className:"min-w-0 flex-[1_1_18rem]",children:[t.jsx("p",{className:"font-black text-white truncate",children:e.company}),t.jsxs("p",{className:"text-xs text-white/50 truncate",children:[e.name,e.signedAt?` · signed ${new Date(e.signedAt).toLocaleDateString("en-GB")}`:""]})]}),t.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[e.completeness!==null&&t.jsxs("span",{className:"text-xs text-white/60",children:[e.completeness,"% filled"]}),t.jsx("span",{className:`px-3 py-1 rounded-pill text-[11px] font-bold ${e.status==="complete"?"bg-emerald-400/15 text-emerald-300":e.status==="draft"?"bg-amber-400/15 text-amber-200":"bg-white/5 text-white/50"}`,children:e.status==="complete"?"Confirmed":e.status==="draft"?"Draft":"Not started"})]})]},e.quoteId))})]})}export{S 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.