PageSourceSearch

https://foamglow.com/assets/FundraiseDashboard-Dx-HUUW4.js

js foamglow.com collected 2026-09-30 13:42:12 UTC 12,296 bytes, 6 lines download raw bytes

1import{c as ie,u as le,r as t,j as e,L as w,B as o,b as $}from"./index-Dehqc7cc.js";import{C as l,a as n}from"./card-DZbbnuGV.js";import{B as u}from"./badge-Gmj_ZuIH.js";import{T as ne,a as oe,b as R,c as p,d as ce,e as b}from"./table-B0MR5e2t.js";import{T as de,a as me,b as j,c as f}from"./tabs-B87iGL9g.js";import{L as y,S as D}from"./SEOHead-DnfH-Wfc.js";import{m as B,U as he,s as c}from"./client-Bw6Mo37w.js";import{M as A}from"./map-pin-DkYgOWcU.js";import{C as xe}from"./circle-check-big-DQ0O4iaU.js";import{S as ue}from"./share-2-D_18lOvi.js";import{D as v,C as q}from"./index-D0YX9d6v.js";import{C as pe}from"./clock-Cux2o9Pn.js";import{E as be}from"./external-link-qMviIEAo.js";import{T as je}from"./trophy-CJ_w2PBl.js";import{f as k}from"./format--YuNkvsf.js";import"./index-CotvKMWO.js";/**
2 * @license lucide-react v0.462.0 - ISC
3 *
4 * This source code is licensed under the ISC license.
5 * See the LICENSE file in the root directory of this source tree.
6 */const F=ie("Copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]]),fe={initial:{opacity:0,y:30},animate:{opacity:1,y:0},transition:{duration:.6}};function Re(){const{token:m}=le(),[r,z]=t.useState(null),[V,g]=t.useState(!0),[U,S]=t.useState(!1),[H,I]=t.useState([]),[i,Y]=t.useState([]),[C,G]=t.useState([]),[_,O]=t.useState([]),[N,K]=t.useState([]),[W,T]=t.useState(!1);t.useEffect(()=>{if(!m)return;(async()=>{g(!0);try{const{data:a,error:P}=await c.from("fundraise_groups").select("*").eq("access_token",m).eq("status","approved");if(P)throw P;if(!a||a.length===0){S(!0),g(!1);return}const d=a[0];z(d);const[ee,se,te,ae,re]=await Promise.all([c.from("fundraise_volunteer_assignments").select("*").eq("group_id",d.id),c.from("fundraise_payouts").select("*").eq("group_id",d.id).order("created_at",{ascending:!1}),c.from("fundraise_partnerships").select("*").eq("group_id",d.id),c.from("events").select("*").eq("status","upcoming").order("date",{ascending:!0}).limit(20),c.from("fundraise_referrals").select("*").eq("referrer_group_id",d.id)]);I(ee.data||[]),Y(se.data||[]),G(te.data||[]),O(ae.data||[]),K(re.data||[])}catch{S(!0)}finally{g(!1)}})()},[m]);const J=t.useMemo(()=>i.reduce((s,a)=>s+Number(a.total_amount),0),[i]),Q=t.useMemo(()=>i.filter(s=>s.status==="paid").reduce((s,a)=>s+Number(a.total_amount),0),[i]),X=t.useMemo(()=>i.filter(s=>s.status==="pending").reduce((s,a)=>s+Number(a.total_amount),0),[i]),Z=H.length,L=t.useMemo(()=>new Set(C.map(s=>s.event_id)),[C]),M=t.useMemo(()=>_.filter(s=>L.has(s.id)),[_,L]),h=r?`https://eventlab.com/fundraise?ref=${r.id}`:"",E=r?`https://eventlab.com/fundraise/dashboard/${m}`:"",x=s=>{navigator.clipboard.writeText(s),T(!0),$.success("Link copied!"),setTimeout(()=>T(!1),2e3)};return V?e.jsx(y,{children:e.jsx("div",{className:"min-h-screen bg-[hsl(213,80%,10%)] flex items-center justify-center",children:e.jsx("div",{className:"animate-spin h-8 w-8 border-4 border-[#39FF14] border-t-transparent rounded-full"})})}):U||!r?e.jsxs(y,{children:[e.jsx(D,{title:"Dashboard Not Found | EventLab",description:"This fundraise dashboard link is invalid or expired.",canonicalPath:"/fundraise",noindex:!0}),e.jsx("div",{className:"min-h-screen bg-[hsl(213,80%,10%)] flex items-center justify-center text-white",children:e.jsxs("div",{className:"text-center px-4",children:[e.jsx("h1",{className:"text-3xl font-black mb-4",children:"Dashboard Not Found"}),e.jsx("p",{className:"text-white/60 mb-6",children:"This dashboard link is invalid, expired, or the group has not been approved yet."}),e.jsx(w,{to:"/fundraise",children:e.jsx(o,{className:"bg-[#39FF14] text-[#0A2540] font-bold border-0",children:"Back to Fundraise"})})]})})]}):e.jsxs(y,{children:[e.jsx(D,{title:`${r.org_name} Dashboard | EventLab Fundraise`,description:`Track earnings and manage volunteers for ${r.org_name}`,canonicalPath:"/fundraise",noindex:!0}),e.jsx("section",{className:"bg-[hsl(213,80%,10%)] pt-8 pb-6 border-b border-white/10",children:e.jsx("div",{className:"container mx-auto px-4",children:e.jsxs(B.div,{...fe,children:[e.jsx(w,{to:"/fundraise",className:"text-[#39FF14] hover:text-[#00E676] text-sm font-medium mb-4 inline-block",children:"← Back to Fundraise"}),e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-4",children:[e.jsxs("div",{children:[e.jsx(u,{className:"bg-[#39FF14] text-[#0A2540] font-bold border-0 mb-2",children:r.org_type.replace(/-/g," ").replace(/\b\w/g,s=>s.toUpperCase())}),e.jsx("h1",{className:"text-2xl md:text-4xl font-black text-white",children:r.org_name}),e.jsxs("p",{className:"text-white/60 text-sm mt-1",children:[e.jsx(A,{className:"inline h-3.5 w-3.5 mr-1"}),r.city,", ",r.state]})]}),e.jsx("div",{className:"flex gap-2",children:e.jsxs(o,{size:"sm",variant:"outline",className:"border-white/20 text-white hover:bg-white/10",onClick:()=>x(h),children:[W?e.jsx(xe,{className:"h-4 w-4 mr-1"}):e.jsx(ue,{className:"h-4 w-4 mr-1"})," Share Referral Link"]})})]})]})})}),e.jsx("section",{className:"bg-[hsl(213,80%,10%)] py-8 min-h-[60vh]",children:e.jsxs("div",{className:"container mx-auto px-4",children:[e.jsx("div",{className:"grid grid-cols-2 md:grid-cols-4 gap-4 mb-8",children:[{icon:v,label:"Total Earned",value:`$${J.toLocaleStr
6ing()}`,color:"text-[#39FF14]"},{icon:v,label:"Paid Out",value:`$${Q.toLocaleString()}`,color:"text-green-400"},{icon:pe,label:"Pending",value:`$${X.toLocaleString()}`,color:"text-yellow-400"},{icon:he,label:"Volunteer Shifts",value:Z.toString(),color:"text-blue-400"}].map((s,a)=>e.jsx(B.div,{initial:{opacity:0,y:20},animate:{opacity:1,y:0},transition:{delay:a*.1},children:e.jsx(l,{className:"bg-white/5 border-white/10",children:e.jsxs(n,{className:"pt-5 pb-4 text-center",children:[e.jsx(s.icon,{className:`h-6 w-6 mx-auto mb-2 ${s.color}`}),e.jsx("p",{className:`text-xl md:text-2xl font-black ${s.color}`,children:s.value}),e.jsx("p",{className:"text-white/50 text-xs mt-1",children:s.label})]})})},s.label))}),e.jsxs(de,{defaultValue:"payouts",className:"w-full",children:[e.jsxs(me,{className:"bg-white/5 border-white/10",children:[e.jsx(j,{value:"payouts",children:"Payouts"}),e.jsx(j,{value:"events",children:"Matched Events"}),e.jsx(j,{value:"referrals",children:"Referrals"}),e.jsx(j,{value:"share",children:"Share & Promote"})]}),e.jsx(f,{value:"payouts",children:e.jsx(l,{className:"bg-white/5 border-white/10 mt-4",children:e.jsx(n,{className:"p-0",children:i.length===0?e.jsxs("div",{className:"py-12 text-center text-white/50",children:[e.jsx(v,{className:"h-10 w-10 mx-auto mb-3 opacity-30"}),e.jsx("p",{children:"No payouts yet. Volunteer at events to start earning!"})]}):e.jsxs(ne,{children:[e.jsx(oe,{children:e.jsxs(R,{className:"border-white/10",children:[e.jsx(p,{className:"text-white/60",children:"Amount"}),e.jsx(p,{className:"text-white/60",children:"Status"}),e.jsx(p,{className:"text-white/60",children:"Paid At"}),e.jsx(p,{className:"text-white/60",children:"Created"})]})}),e.jsx(ce,{children:i.map(s=>e.jsxs(R,{className:"border-white/10",children:[e.jsxs(b,{className:"text-white font-bold",children:["$",Number(s.total_amount).toLocaleString()]}),e.jsx(b,{children:e.jsx(u,{className:s.status==="paid"?"bg-green-500/20 text-green-400":"bg-yellow-500/20 text-yellow-400",children:s.status})}),e.jsx(b,{className:"text-white/60 text-sm",children:s.paid_at?k(new Date(s.paid_at),"MMM d, yyyy"):"—"}),e.jsx(b,{className:"text-white/60 text-sm",children:k(new Date(s.created_at),"MMM d, yyyy")})]},s.id))})]})})})}),e.jsx(f,{value:"events",children:e.jsx("div",{className:"mt-4 grid grid-cols-1 md:grid-cols-2 gap-4",children:M.length===0?e.jsx(l,{className:"bg-white/5 border-white/10 col-span-full",children:e.jsxs(n,{className:"py-12 text-center text-white/50",children:[e.jsx(q,{className:"h-10 w-10 mx-auto mb-3 opacity-30"}),e.jsx("p",{children:"No matched events yet. We'll pair you with upcoming events soon!"})]})}):M.map(s=>e.jsx(l,{className:"bg-white/5 border-white/10",children:e.jsxs(n,{className:"p-5",children:[e.jsx("h3",{className:"text-white font-bold mb-2",children:s.title}),e.jsxs("p",{className:"text-white/60 text-sm",children:[e.jsx(A,{className:"inline h-3.5 w-3.5 mr-1"}),s.city,", ",s.state]}),e.jsxs("p",{className:"text-white/60 text-sm mt-1",children:[e.jsx(q,{className:"inline h-3.5 w-3.5 mr-1"}),k(new Date(s.date),"MMM d, yyyy")]}),e.jsx(w,{to:`/events/${s.id}`,children:e.jsxs(o,{size:"sm",className:"mt-3 bg-[#39FF14] text-[#0A2540] font-bold border-0 hover:bg-[#00E676]",children:["View Event ",e.jsx(be,{className:"ml-1 h-3.5 w-3.5"})]})})]})},s.id))})}),e.jsx(f,{value:"referrals",children:e.jsx(l,{className:"bg-white/5 border-white/10 mt-4",children:e.jsxs(n,{className:"p-6",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-4",children:[e.jsx(je,{className:"h-5 w-5 text-[#39FF14]"}),e.jsx("h3",{className:"text-white font-bold",children:"Your Referrals"}),e.jsxs(u,{className:"bg-[#39FF14]/20 text-[#39FF14] border-0",children:[N.length," referred"]})]}),N.length===0?e.jsxs("div",{className:"text-center py-8 text-white/50",children:[e.jsx("p",{children:"Refer other groups and earn a $25 bonus per approved referral!"}),e.jsxs(o,{size:"sm",className:"mt-4 bg-[#39FF14] text-[#0A2540] font-bold border-0",onClick:()=>x(h),children:[e.jsx(F,{className:"h-4 w-4 mr-1"})," Copy Referral Link"]})]}):e.jsx("div",{className:"space-y-2",children:N.map(s=>e.jsxs("div",{className:"flex items-center justify-between border border-white/10 rounded-lg p-3",children:[e.jsx("span",{className:"text-white text-sm",children:"Group referred"}),e.jsxs("div",{className:"flex items-center gap-2",children:[e.jsx(u,{className:s.status==="approved"?"bg-green-500/20 text-green-400":"bg-yellow-500/20 text-yellow-400",children:s.status}),e.jsxs("span",{className:"text-[#39FF14] font-bold text-sm",children:["$",Number(s.bonus_amount)]})]})]},s.id))})]})})}),e.jsx(f,{value:"share",children:e.jsx(l,{className:"bg-white/5 border-white/10 mt-4",children:e.jsxs(n,{className:"p-6 space-y-6",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"text-white font-bold mb-2",children:"📣 Your Campaign Link"}),e.jsx("p",{className:"text-white/50 text-sm mb-3",children:"Share this link so volunteers know they're signing up for your group."}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("code",{className:"flex-1 bg-white/5 border border-white/10 rounded-lg px-3 py-2 text-white/80 text-sm truncate",children:h}),e.jsx(o,{size:"sm",className:"bg-[#39FF14] text-[#0A2540] font-bold border-0",onClick:()=>x(h),children:e.jsx(F,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-white font-bold mb-2",children:"🏠 Your Dashboard Link"}),e.jsx("p",{className:"text-white/50 text-sm mb-3",children:"Bookmark this link to return to your dashboard anytime (keep it private!)."}),e.jsxs("div",{className:"flex gap-2",children:[e.jsx("code",{className:"flex-1 bg-white/5 border border-white/10 rounded-lg px-3 py-2 text-white/80 text-sm truncate",children:E}),e.jsx(o,{size:"sm",variant:"outline",className:"border-white/20 text-white hover:bg-white/10",onClick:()=>x(E),children:e.jsx(F,{className:"h-4 w-4"})})]})]}),e.jsxs("div",{children:[e.jsx("h3",{className:"text-white font-bold mb-2",children:"🎨 Marketing Kit"}),e.jsx("p",{className:"text-white/50 text-sm mb-3",children:"Download social media graphics and flyers to promote your fundraiser."}),e.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[{label:"Social Media Post",desc:"Perfect for Instagram, Facebook, and Twitter"},{label:"Flyer Template",desc:"Print-ready flyer for your community board"},{label:"Email Template",desc:"Copy-paste email to send to potential volunteers"},{label:"Team Sign-Up Sheet",desc:"Printable sheet for collecting volunteer info"}].map(s=>e.jsx(l,{className:"bg-white/5 border-white/10 cursor-pointer hover:border-[#39FF14]/30 transition-colors",onClick:()=>$.info("Marketing kit coming soon!"),children:e.jsxs(n,{className:"p-4",children:[e.jsx("p",{className:"text-white font-bold text-sm",children:s.label}),e.jsx("p",{className:"text-white/40 text-xs mt-1",children:s.desc})]})},s.label))})]})]})})})]})]})})]})}export{Re 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.