PageSourceSearch

https://plant4growthuk-production-a1cd.up.railway.app/static/js/9006.99f06acb.chunk.js

js plant4growthuk-production-a1cd.up.railway.app collected 2026-10-03 12:14:31 UTC 7,445 bytes, 3 lines download raw bytes

1/*! For license information please see 9006.99f06acb.chunk.js.LICENSE.txt */
2"use strict";(self.webpackChunkfrontend=self.webpackChunkfrontend||[]).push([[9006],{516(e,s,t){t.d(s,{A:()=>a});const a=(0,t(7784).A)("refresh-cw",[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]])},5088(e,s,t){t.d(s,{A:()=>a});const a=(0,t(7784).A)("clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]])},9006(e,s,t){t.r(s),t.d(s,{default:()=>N});var a=t(5043),l=t(4980),i=t(6328),r=t(9970),n=t(1140),c=t(2264),d=t(5949),m=t(3390),o=t(2024),x=t(5088),h=t(7104),p=t(5327),j=t(516),u=t(9292),g=t(7118),v=t(579);const N=()=>{const[e,s]=(0,a.useState)([]),[t,N]=(0,a.useState)(!0),[f,w]=(0,a.useState)(""),y=async()=>{N(!0);try{const e=await l.WZ.getAdminWaitlist();s(e.data||[])}catch(a){var e,t;const s=null===(e=a.response)||void 0===e||null===(t=e.data)||void 0===t?void 0:t.detail;i.oR.error("string"===typeof s?s:"Failed to load waitlist"),console.error(a)}finally{N(!1)}};(0,a.useEffect)(()=>{y()},[]);const A=e.filter(e=>{var s,t,a,l;const i=f.toLowerCase();return(null===(s=e.name)||void 0===s?void 0:s.toLowerCase().includes(i))||(null===(t=e.email)||void 0===t?void 0:t.toLowerCase().includes(i))||(null===(a=e.programme_title)||void 0===a?void 0:a.toLowerCase().includes(i))||(null===(l=e.programme_slug)||void 0===l?void 0:l.toLowerCase().includes(i))}),b=A.reduce((e,s)=>{const t=s.programme_slug||"unknown";return e[t]||(e[t]={title:s.programme_title||s.programme_slug,slug:s.programme_slug,entries:[]}),e[t].entries.push(s),e},{});return(0,v.jsx)(r.NI,{children:(0,v.jsxs)("div",{className:"space-y-6 p-6",children:[(0,v.jsxs)("div",{className:"flex flex-col sm:flex-row justify-between items-start sm:items-center gap-4",children:[(0,v.jsxs)("div",{children:[(0,v.jsx)("h1",{className:"text-2xl font-bold text-[#0D1B2A]",children:"Programme Waitlist"}),(0,v.jsx)("p",{className:"text-slate-500 mt-1",children:"Users who registered interest in sold-out programmes"})]}),(0,v.jsxs)("div",{className:"flex gap-2",children:[(0,v.jsxs)(m.$,{variant:"outline",size:"sm",onClick:y,disabled:t,children:[(0,v.jsx)(j.A,{className:"w-4 h-4 mr-2 ".concat(t?"animate-spin":"")}),"Refresh"]}),(0,v.jsxs)(m.$,{variant:"outline",size:"sm",onClick:()=>{if(0===e.length)return void i.oR.error("No data to export");const s=e.map(e=>[e.name,e.email,e.programme_title||e.programme_slug,new Date(e.created_at).toLocaleDateString("en-GB")]),t=[["Name","Email","Programme","Date Joined"].join(","),...s.map(e=>e.map(e=>'"'.concat(e||"",'"')).join(","))].join("\n"),a=new Blob([t],{type:"text/csv"}),l=window.URL.createObjectURL(a),r=document.createElement("a");r.href=l,r.download="waitlist_".concat((new Date).toISOString().split("T")[0],".csv"),r.click(),window.URL.revokeObjectURL(l),i.oR.success("Waitlist exported")},disabled:0===e.length,children:[(0,v.jsx)(h.A,{className:"w-4 h-4 mr-2"}),"Export CSV"]})]})]}),(0,v.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-4",children:[(0,v.jsx)(n.Zp,{children:(0,v.jsx)(n.Wu,{className:"pt-6",children:(0,v.jsxs)("div",{className:"flex items-center gap-4",children:[(0,v.jsx)("div",{className:"p-3 bg-[#41EAD4]/10 rounded-lg",children:(0,v.jsx)(g.A,{className:"w-6 h-6 text-[#41EAD4]"})}),(0,v.jsxs)("div",{children:[(0,v.jsx)("p",{className:"text-2xl font-bold text-[#0D1B2A]",children:e.length}),(0,v.jsx)("p",{className:"text-sm text-slate-500",children:"Total Entries"})]})]})})}),(0,v.jsx)(n.Zp,{children:(0,v.jsx)(n.Wu,{className:"pt-6",children:(0,v.jsxs)("div",{className:"flex items-center gap-4",children:[(0,v.jsx)("div",{className:"p-3 bg-[#C9A84C]/10 rounded-lg",children:(0,v.jsx)(p.A,{className:"w-6 h-6 text-[#C9A84C]"})}),(0,v.jsxs)("div",{children:[(0,v.jsx)("p",{className:"text-2xl font-bold text-[#0D1B2A]",children:new Set(e.map(e=>e.email)).size}),(0,v.jsx)("p",{className:"text-sm text-slate-500",children:"Unique Emails"})]})]})})}),(0,v.jsx)(n.Zp,{children:(0,v.jsx)(n.Wu,{className:"pt-6",children:(0,v.jsxs)("div",{className:"flex items-center gap-4",children:[(0,v.jsx)("div",{className:"p-3 bg-[#0D1B2A]/10 rounded-lg",children:(0,v.jsx)(x.A,{className:"w-6 h-6 text-[#0D1B2A]"})}),(0,v.jsxs)("div",{children:[(0,v.jsx)("p",{className:"text-2xl font-bold text-[#0D1B2A]",children:Object.keys(b).length}),(0,v.jsx)("p",{className:"text-sm text-slate-500",children:"Programmes"})]})]})})})]}),(0,v.jsxs)("div",{className:"relative max-w-md",children:[(0,v.jsx)(u.A,{className:"absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-slate-400"}),(0,v.jsx)(c.p,{placeholder:"Search by name, email, or programme...",value:f,onChange:e=>w(e.target.value),className:"pl-10"})]}),t?(0,v.jsx)("div",{className:"flex justify-center py-12",children:(0,v.jsx)(o.A,{className:"w-8 h-8 animate-spin text-[#41EAD4]"})}):0===e.length?(0,v.jsx)(n.Zp,{children:(0,v.jsxs)(n.Wu,{className:"py-12 text-center",children:[(0,v.jsx)(g.A,{className:"w-12 h-12 text-slate-300 mx-auto mb-4"}),(0,v.jsx)("h3",{className:"text-lg font-semibold text-slate-600 mb-2",children:"No waitlist entr
2ies yet"}),(0,v.jsx)("p",{className:"text-slate-500",children:"When users join the waitlist for sold-out programmes, they'll appear here."})]})}):0===A.length?(0,v.jsx)(n.Zp,{children:(0,v.jsxs)(n.Wu,{className:"py-12 text-center",children:[(0,v.jsx)(u.A,{className:"w-12 h-12 text-slate-300 mx-auto mb-4"}),(0,v.jsx)("h3",{className:"text-lg font-semibold text-slate-600 mb-2",children:"No results found"}),(0,v.jsx)("p",{className:"text-slate-500",children:"Try adjusting your search term."})]})}):(0,v.jsx)("div",{className:"space-y-6",children:Object.values(b).map(e=>(0,v.jsxs)(n.Zp,{children:[(0,v.jsx)(n.aR,{className:"pb-3",children:(0,v.jsxs)("div",{className:"flex items-center justify-between",children:[(0,v.jsx)(n.ZB,{className:"text-lg font-semibold text-[#0D1B2A]",children:e.title}),(0,v.jsxs)(d.E,{variant:"secondary",className:"bg-[#C9A84C]/10 text-[#C9A84C]",children:[e.entries.length," ",1===e.entries.length?"person":"people"]})]})}),(0,v.jsx)(n.Wu,{children:(0,v.jsx)("div",{className:"divide-y",children:e.entries.map((e,s)=>{var t,a;return(0,v.jsxs)("div",{className:"py-3 flex items-center justify-between",children:[(0,v.jsxs)("div",{className:"flex items-center gap-3",children:[(0,v.jsx)("div",{className:"w-10 h-10 rounded-full bg-[#0D1B2A] flex items-center justify-center text-white font-semibold",children:(null===(t=e.name)||void 0===t||null===(a=t.charAt(0))||void 0===a?void 0:a.toUpperCase())||"?"}),(0,v.jsxs)("div",{children:[(0,v.jsx)("p",{className:"font-medium text-[#0D1B2A]",children:e.name}),(0,v.jsxs)("a",{href:"mailto:".concat(e.email),className:"text-sm text-[#41EAD4] hover:underline flex items-center gap-1",children:[(0,v.jsx)(p.A,{className:"w-3 h-3"}),e.email]})]})]}),(0,v.jsxs)("div",{className:"text-right",children:[(0,v.jsx)("p",{className:"text-sm text-slate-500",children:new Date(e.created_at).toLocaleDateString("en-GB",{day:"numeric",month:"short",year:"numeric"})}),(0,v.jsx)("p",{className:"text-xs text-slate-400",children:new Date(e.created_at).toLocaleTimeString("en-GB",{hour:"2-digit",minute:"2-digit"})})]})]},e.waitlist_id||s)})})})]},e.slug))})]})})}}}]);
3//# sourceMappingURL=9006.99f06acb.chunk.js.map

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.