PageSourceSearch

https://sevachild.org/assets/PartnerDashboardOverview-ZPI_6Ul8.js

js sevachild.org collected 2026-10-06 12:31:29 UTC 8,193 bytes, 7 lines download raw bytes

1const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/PartnerImpactMap-DKESpzhb.js","assets/index--q7BMy73.js","assets/index-B_fJINRQ.css","assets/leaflet-BZt2510E.js","assets/leaflet-Dgihpmma.css"])))=>i.map(i=>d[i]);
2import{c as P,j as e,e as x,r as h,_ as F,d as m,s as p,L as S}from"./index--q7BMy73.js";import{u as L}from"./use-partner-dashboard-Cjx4u2we.js";import{T as q}from"./trending-up-DkQ0Ahhe.js";import{CATEGORY_CONFIG as A}from"./PartnerImpactMap-DKESpzhb.js";import{A as I}from"./ActivityTimeline-Ce2vXJbe.js";import{S as B}from"./SEOHead-BqqI_484.js";import{P as M}from"./progress-CThpnvYp.js";import{L as E}from"./loader-circle-bi7eL-pN.js";import{U as O}from"./users-D8sZ1YSN.js";import{F as T}from"./folder-kanban-C46_TRw8.js";import"./leaflet-BZt2510E.js";import"./format-BwcsVm1d.js";import"./en-US-DWrl2lTx.js";/**
3 * @license lucide-react v0.462.0 - ISC
4 *
5 * This source code is licensed under the ISC license.
6 * See the LICENSE file in the root directory of this source tree.
7 */const D=P("Baby",[["path",{d:"M9 12h.01",key:"157uk2"}],["path",{d:"M15 12h.01",key:"1k8ypt"}],["path",{d:"M10 16c.5.3 1.2.5 2 .5s1.5-.2 2-.5",key:"1u7htd"}],["path",{d:"M19 6.3a9 9 0 0 1 1.8 3.9 2 2 0 0 1 0 3.6 9 9 0 0 1-17.6 0 2 2 0 0 1 0-3.6A9 9 0 0 1 12 3c2 0 3.5 1.1 3.5 2.5s-.9 2.5-2 2.5c-.8 0-1.5-.4-1.5-1",key:"5yv0yz"}]]),u=({label:o,value:r,subtitle:d,icon:i,accentColor:l,growth:s})=>e.jsxs("div",{className:"group relative overflow-hidden rounded-lg border border-border bg-card p-5 transition-shadow hover:shadow-md",children:[e.jsx("div",{className:"absolute top-0 left-0 right-0 h-[3px]",style:{backgroundColor:l||"hsl(var(--primary))"}}),e.jsxs("div",{className:"flex items-start justify-between",children:[e.jsxs("div",{children:[e.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:o}),e.jsx("p",{className:"mt-1 font-sans text-3xl font-bold tracking-tight",children:typeof r=="number"?r.toLocaleString():r}),d&&e.jsx("p",{className:"mt-1 text-xs text-muted-foreground",children:d}),s&&e.jsxs("span",{className:"mt-1.5 inline-flex items-center gap-1 rounded-full bg-emerald-50 px-2 py-0.5 text-[10px] font-semibold text-emerald-600",children:[e.jsx(q,{className:"h-2.5 w-2.5"}),s]})]}),e.jsx("div",{className:x("flex h-10 w-10 items-center justify-center rounded-lg"),style:{backgroundColor:(l||"hsl(var(--primary))")+"15"},children:e.jsx(i,{className:"h-5 w-5",style:{color:l||"hsl(var(--primary))"}})})]})]}),$=[{key:"water",stat:"200+ wells · 30,000+ people"},{key:"micronutrients",stat:"6M+ children supplemented"},{key:"disaster_relief",stat:"3,100+ ration kits · 15,000+ fed"},{key:"education",stat:"94% completion rate"},{key:"sponsorship",stat:"5+ village communities"}],K=({activeFilter:o,onFilter:r})=>e.jsxs("div",{className:"flex flex-wrap gap-2",children:[e.jsx("button",{onClick:()=>r("all"),className:x("rounded-full px-3 py-1.5 text-xs font-semibold transition-colors border",o==="all"?"border-foreground bg-foreground text-background":"border-border bg-card text-muted-foreground hover:border-foreground
7/30"),children:"All Programs"}),$.map(({key:d,stat:i})=>{const l=A[d],s=o===d;return e.jsxs("button",{onClick:()=>r(d),className:x("rounded-full px-3 py-1.5 text-xs font-medium transition-all border",s?"border-transparent text-white":"border-border bg-card text-muted-foreground hover:border-foreground/30"),style:s?{backgroundColor:l.color}:void 0,children:[l.emoji," ",l.label,e.jsxs("span",{className:"ml-1.5 hidden sm:inline opacity-70",children:["— ",i]})]},d)})]}),z=h.lazy(()=>F(()=>import("./PartnerImpactMap-DKESpzhb.js"),__vite__mapDeps([0,1,2,3,4]))),re=()=>{const{partner:o,projects:r,isLoading:d}=L(),[i,l]=h.useState("all"),s=r.map(t=>t.id),{data:y=[]}=m({queryKey:["all-projects-for-map"],queryFn:async()=>{const{data:t,error:a}=await p.from("projects").select("id, name, latitude, longitude, program_category, status, people_served, completion_percentage");if(a)throw a;return t||[]}}),{data:n=[]}=m({queryKey:["partner-updates",s],queryFn:async()=>{if(s.length===0)return[];const{data:t,error:a}=await p.from("project_updates").select("id, update_text, update_date, project_id").in("project_id",s).order("update_date",{ascending:!1}).limit(10);if(a)throw a;return(t||[]).map(b=>{var v;return{...b,project_name:((v=r.find(C=>C.id===b.project_id))==null?void 0:v.name)||""}})},enabled:s.length>0}),{data:g=[]}=m({queryKey:["partner-photos",s],queryFn:async()=>{if(s.length===0)return[];const{data:t,error:a}=await p.from("project_images").select("id, image_url, caption, project_id").in("project_id",s).order("display_order").limit(4);if(a)throw a;return t||[]},enabled:s.length>0});if(d)return e.jsx("div",{className:"flex min-h-[60vh] items-center justify-center",children:e.jsx(E,{className:"h-6 w-6 animate-spin text-muted-foreground"})});const N=r.reduce((t,a)=>t+(a.people_served||0),0),w=r.reduce((t,a)=>t+(a.children_served||0),0),_=r.filter(t=>t.status==="completed").length,f=r.filter(t=>t.status==="underway").length,c=(o==null?void 0:o.total_committed)||0,j=(o==null?void 0:o.total_disbursed)||0,k=c>0?Math.round(j/c*100):0;return e.jsxs("div",{className:"mx-auto max-w-6xl px-4 py-6 sm:px-6 sm:py-10",children:[e.jsx(B,{title:"Partner Overview — SevaChild",description:"SevaChild partner dashboard.",noIndex:!0}),e.jsxs("div",{className:"grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-4 sm:gap-4",children:[e.jsx(u,{label:"Total Beneficiaries",value:N,icon:O,accentColor:"hsl(var(--impact-green))",growth:"+12% vs last quarter"}),e.jsx(u,{label:"Children Served",value:w,icon:D,accentColor:"#8B5CF6",growth:"+120 this quarter"}),e.jsx(u,{label:"Projects Funded",value:r.length,subtitle:`${_} completed · ${f} active`,icon:T,accentColor:"#3B82F6",growth:`+${f} active`}),e.jsxs("div",{className:"relative overflow-hidden rounded-lg border border-border bg-card p-5 transition-shadow hover:shadow-md",children:[e.jsx("div",{className:"absolute top-0 left-0 right-0 h-[3px] bg-primary"}),e.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider text-muted-foreground",children:"Funds Deployed"}),e.jsxs("p",{className:"mt-1 font-sans text-3xl font-bold tracking-tight",children:["$",j.toLocaleString()]}),e.jsxs("p",{className:"mt-1 text-xs text-muted-foreground",children:["of $",c.toLocaleString()," committed"]}),e.jsx(M,{value:k,className:"mt-2 h-1.5"})]})]}),e.jsx("div",{className:"mt-6",children:e.jsx(K,{activeFilter:i,onFilter:l})}),e.jsx("div",{className:"mt-4 overflow-hidden rounded-lg border border-border",style:{height:"clamp(280px, 40vw, 400px)"},children:e.jsx(h.Suspense,{fallback:e.jsx("div",{className:"h-full w-full animate-pulse bg-muted"}),children:e.jsx(z,{projects:r,networkProjects:y,activeFilter:i})})}),e.jsxs("div",{className:"mt-8 grid gap-8 lg:grid-cols-3",children:[e.jsxs("div",{className:"lg:col-span-2",children:[e.jsxs("div",{className:"flex items-center justify-between mb-4",children:[e.jsx("h2",{className:"font-serif text-lg font-bold",children:"Live Impact Feed"}),n.length>8&&e.jsx(S,{to:"/partner-dashboard/projects",className:"text-xs font-medium text-primary hover:underline",children:"View All"})]}),n.length===0?e.jsx("div",{className:"rounded-lg border border-border bg-card p-8 text-center",children:e.jsx("p",{className:"text-sm text-muted-foreground",children:"Impact updates will appear here as projects progress."})}):e.jsx(I,{updates:n})]}),e.jsxs("div",{children:[e.jsx("h2",{className:"font-serif text-lg font-bold mb-4",children:"Impact Photos"}),g.length===0?e.jsx("p",{className:"text-sm text-muted-foreground",children:"Field photos coming soon."}):e.jsx("div",{className:"grid grid-cols-2 gap-2",children:g.map(t=>e.jsxs("div",{className:"group relative overflow-hidden rounded-lg",children:[e.jsx("img",{src:t.image_url,alt:t.caption||"",className:"aspect-square w-full object-cover transition-transform group-hover:scale-105",loading:"lazy"}),t.caption&&e.jsx("div",{className:"absolute inset-x-0 bottom-0 bg-gradient-to-t from-black/60 to-transparent p-2",children:e.jsx("p",{className:"text-[10px] text-white",children:t.caption})})]},t.id))})]})]})]})};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.