PageSourceSearch

https://apexswipe.com/assets/admin.host-applications-B6G0HRw7.js

js apexswipe.com collected 2026-10-02 01:23:41 UTC 9,029 bytes, 1 lines download raw bytes

1import{d as w,i as z,k as I,m as M,g as R,u as U,r as a,j as e,L as A}from"./index-BmK_Y2lq.js";const G=[{value:"all",label:"All"},{value:"pending",label:"Pending"},{value:"contacted",label:"Contacted"},{value:"onboarding",label:"Onboarding"},{value:"live",label:"Live"},{value:"rejected",label:"Rejected"}],L={pending:"bg-amber-500/15 text-amber-300 border-amber-500/30",contacted:"bg-blue-500/15 text-blue-300 border-blue-500/30",onboarding:"bg-violet-500/15 text-violet-300 border-violet-500/30",live:"bg-emerald-500/15 text-emerald-300 border-emerald-500/30",rejected:"bg-rose-500/15 text-rose-300 border-rose-500/30"};function _({status:s}){return e.jsx("span",{className:`inline-flex items-center rounded-full border px-2.5 py-0.5 text-xs font-medium capitalize ${L[s]}`,children:s})}function W(){const s=w(z),c=w(I),N=w(M),v=w(R),x=U(),[o,p]=a.useState("all"),[d,l]=a.useState(""),[S,T]=a.useState(""),[h,b]=a.useState([]),[k,C]=a.useState(!0),[D,u]=a.useState(null),[n,g]=a.useState(null);a.useEffect(()=>{const t=setTimeout(()=>T(d),250);return()=>clearTimeout(t)},[d]);const E=a.useCallback(async()=>{C(!0),u(null);try{const t=await s({data:{status:o,search:S}});t.ok?b(t.rows):u(t.error)}catch{u("Failed to load applications.")}finally{C(!1)}},[s,o,S]);a.useEffect(()=>{E()},[E]);const P=a.useMemo(()=>h.length,[h]);async function F(t,i){const j=h;b(m=>m.map(y=>y.id===t?{...y,status:i}:y)),n?.id===t&&g({...n,status:i});const f=await c({data:{id:t,status:i}});f.ok||(b(j),u(f.error))}async function H(t,i){const j=await N({data:{id:t,notes:i||null}});j.ok?(b(f=>f.map(m=>m.id===t?{...m,notes:i||null}:m)),n?.id===t&&g({...n,notes:i||null})):u(j.error)}async function $(){await v({}),x({to:"/admin/login"})}return e.jsxs("div",{className:"min-h-screen bg-[#050505] text-white",children:[e.jsxs("header",{className:"sticky top-0 z-20 border-b border-white/[0.06] bg-[#050505]/80 backdrop-blur",children:[e.jsxs("div",{className:"mx-auto flex max-w-[1400px] items-center justify-between gap-4 px-6 py-4",children:[e.jsxs("div",{className:"flex items-center gap-3",children:[e.jsx("h1",{className:"text-base font-semibold",children:"Admin"}),e.jsxs("nav",{className:"ml-2 flex items-center gap-1",children:[e.jsx(A,{to:"/admin/host-applications",className:"rounded-full bg-white/[0.08] px-3 py-1 text-xs text-white",children:"Host applications"}),e.jsx(A,{to:"/admin/waitlist",className:"rounded-full px-3 py-1 text-xs text-white/60 hover:bg-white/[0.06]",children:"Waitlist"})]}),e.jsx("span",{className:"rounded-full border border-white/10 bg-white/5 px-2 py-0.5 text-xs text-white/60",children:k?"…":P})]}),e.jsx("button",{onClick:$,className:"rounded-full border border-white/10 bg-white/[0.04] px-4 py-1.5 text-xs text-white/70 hover:bg-white/[0.08]",children:"Sign out"})]}),e.jsxs("div",{className:"mx-auto flex max-w-[1400px] flex-wrap items-center gap-2 px-6 pb-4",children:[G.map(t=>e.jsx("button",{onClick:()=>p(t.value),className:`rounded-full border px-3 py-1 text-xs transition-colors ${o===t.value?"border-[#25D366]/60 bg-[#25D366]/10 text-[#25D366]":"border-white/10 bg-white/[0.02] text-white/60 hover:bg-white/[0.05]"}`,children:t.label},t.value)),e.jsx("input",{value:d,onChange:t=>l(t.target.value),placeholder:"Search name, email, phone, city",className:"ml-auto w-72 rounded-full border border-white/10 bg-white/[0.03] px-4 py-1.5 text-xs text-white placeholder:text-white/60 focus:border-[#25D366]/60 focus:outline-none"})]})]}),e.jsxs("main",{className:"mx-auto max-w-[1400px] px-6 py-6",children:[D&&e.jsx("div",{className:"mb-4 rounded-xl border border-[#EF4444]/30 bg-[#EF4444]/10 px-4 py-2 text-sm text-[#EF4444]",children:D}),e.jsx("div",{className:"overflow-hidden rounded-2xl border border-white/[0.07] bg-white/[0.02]",children:e.jsxs("table",{className:"w-full text-sm",children:[e.jsx("thead",{className:"bg-white/[0.03] text-left text-xs uppercase tracking-wide text-white/70",children:e.jsxs("tr",{children:[e.jsx("th",{className:"px-4 py-3 font-medium",children:"Date"}),e.jsx("th",{className:"px-4 py-3 font-medium",children:"Name"}),e.jsx("th",{className:"px-4 py-3 font-medium",children:"Email"}),e.jsx("th",{className:"px-4 py-3 font-medium",children:"Phone"}),e.jsx("th",{className:"px-4 py-3 font-medium",children:"City"}),e.jsx("th",{className:"px-4 py-3 font-medium",children:"Category"}),e.jsx("th",{className:"px-4 py-3 font-medium",children:"GMV"}),e.jsx("th",{className:"px-4 py-3 font-medium",children:"Status"})]})}),e.jsx("tbody",{className:"divide-y divide-white/[0.05]",children:k?Array.from({length:6}).map((t,i)=>e.jsx("tr",{children:e.jsx("td",{colSpan:8,className:"px-4 py-4",children:e.jsx("div",{className:"h-4 animate-pulse rounded bg-white/[0.04]"})})},i)):h.length===0?e.jsx("tr",{children:e.jsx("td",{colSpan:8,className:"px-4 py-12 text-center text-white/65",children:"No applications match your filters."})}):h.map(t=>e.jsxs("tr",{onClick:()=>g(t),className:"cursor-pointer hover:bg-white/[0.03]",children:[e.jsx("td",{className:"whitespace-nowrap px-4 py-3 text-white/60",children:new Date(t.created_at).toLocaleDateString("en-IN",{day:"2-digit",month:"short"})}),e.jsx("td",{className:"px-4 py-3 font-medium text-white",children:t.full_name}),e.jsx("td",{className:"px-4 py-3 text-white/70",children:t.email}),e.jsx("td",{className:"px-4 py-3 text-white/70",children:t.phone}),e.jsx("td",{className:"px-4 py-3 text-white/70",children:t.city}),e.jsx("td",{className:"px-4 py-3 text-white/70",children:t.category}),e.jsx("td",{className:"px-4 py-3 text-white/70",children:t.monthly_gmv}),e.jsx("td",{className:"px-4 py-3",children:e.jsx(_,{status:t.status})})]},t.id))})]})})]}),n&&e.jsx(O,{row:n,onClose:()=>g(null),onChangeStatus:t=>F(n.id,t),onSaveNotes:t=>H(n.id,t)})]})}function O({row:s,onClose:c,onChangeStatus:N,onSaveNotes:v}
1){const[x,o]=a.useState(s.notes??""),[p,d]=a.useState(!1);return a.useEffect(()=>{o(s.notes??"")},[s.id,s.notes]),e.jsxs("div",{className:"fixed inset-0 z-30 flex",onClick:c,children:[e.jsx("div",{className:"flex-1 bg-black/60 backdrop-blur-sm"}),e.jsxs("aside",{onClick:l=>l.stopPropagation(),className:"h-full w-full max-w-xl overflow-y-auto border-l border-white/[0.07] bg-[#0a0a0a] p-6",children:[e.jsxs("div",{className:"flex items-start justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-lg font-semibold text-white",children:s.full_name}),e.jsx("p",{className:"text-sm text-white/70",children:new Date(s.created_at).toLocaleString("en-IN")})]}),e.jsx("button",{onClick:c,className:"rounded-full border border-white/10 px-3 py-1 text-xs text-white/60 hover:bg-white/[0.06]",children:"Close"})]}),e.jsxs("dl",{className:"mt-6 grid grid-cols-2 gap-x-4 gap-y-3 text-sm",children:[e.jsx(r,{label:"Email",value:e.jsx("a",{className:"text-[#25D366] hover:underline",href:`mailto:${s.email}`,children:s.email})}),e.jsx(r,{label:"Phone",value:e.jsx("a",{className:"text-[#25D366] hover:underline",href:`tel:${s.phone}`,children:s.phone})}),e.jsx(r,{label:"City",value:s.city}),e.jsx(r,{label:"Category",value:s.category}),e.jsx(r,{label:"Selling for",value:s.selling_duration}),e.jsx(r,{label:"Currently sells on",value:s.current_channels}),e.jsx(r,{label:"Monthly GMV",value:s.monthly_gmv}),e.jsx(r,{label:"Status",value:e.jsx(_,{status:s.status})})]}),e.jsxs("div",{className:"mt-6",children:[e.jsx("h3",{className:"text-xs uppercase tracking-wide text-white/70",children:"Pitch"}),e.jsx("p",{className:"mt-2 whitespace-pre-wrap rounded-xl border border-white/[0.07] bg-white/[0.02] p-4 text-sm text-white/80",children:s.pitch})]}),e.jsxs("div",{className:"mt-6",children:[e.jsx("h3",{className:"text-xs uppercase tracking-wide text-white/70",children:"Update status"}),e.jsx("div",{className:"mt-2 flex flex-wrap gap-2",children:["pending","contacted","onboarding","live","rejected"].map(l=>e.jsx("button",{onClick:()=>N(l),className:`rounded-full border px-3 py-1 text-xs capitalize transition-colors ${s.status===l?L[l]:"border-white/10 bg-white/[0.02] text-white/60 hover:bg-white/[0.05]"}`,children:l},l))})]}),e.jsxs("div",{className:"mt-6",children:[e.jsx("h3",{className:"text-xs uppercase tracking-wide text-white/70",children:"Internal notes"}),e.jsx("textarea",{value:x,onChange:l=>o(l.target.value),rows:5,maxLength:4e3,className:"mt-2 w-full rounded-xl border border-white/10 bg-white/[0.03] px-4 py-3 text-sm text-white placeholder:text-white/60 focus:border-[#25D366]/60 focus:outline-none",placeholder:"Outreach attempts, follow-ups, blockers…"}),e.jsx("button",{onClick:async()=>{d(!0),await v(x),d(!1)},disabled:p||x===(s.notes??""),className:"mt-3 rounded-full bg-[#25D366] px-5 py-2 text-xs font-semibold text-black hover:scale-[1.02] disabled:opacity-50 disabled:hover:scale-100",children:p?"Saving…":"Save notes"})]})]})]})}function r({label:s,value:c}){return e.jsxs("div",{children:[e.jsx("dt",{className:"text-xs uppercase tracking-wide text-white/70",children:s}),e.jsx("dd",{className:"mt-1 text-sm text-white/85",children:c})]})}export{W 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.