PageSourceSearch

https://asean-sdg-sse.com/assets/Partners-Bq7Ui_60.js

js asean-sdg-sse.com collected 2026-10-09 22:00:41 UTC 10,354 bytes, 11 lines download raw bytes

1import{c as O,r as p,j as e,H as h,a4 as $,a5 as D,k as S,B as y,L as C,J as Q,e as H,g as U,O as Y,M as J,s as K}from"./index-l0yqeOKG.js";import{P as W}from"./PageHeader-JIvHC6Bu.js";import{C as L,a as M}from"./card-BtTm3qbe.js";import{S as _,a as A,b as k,c as z,d as N}from"./select-D0nTrfVq.js";import{E as X}from"./EmptyState-DrqzA1kY.js";import{V as Z}from"./VerificationBadge-b4euJBaP.js";import{S as ee}from"./SDGTag-BdXRiGOf.js";import{C as se}from"./CountryFlag-CZjMUBbq.js";import{b as ae}from"./imageMapper-D3ZcJoPX.js";import{F as te}from"./flask-conical-kKI1KYLW.js";import{P as F}from"./plus-CRKUfgTK.js";import{A as re}from"./database-DtV4NUF9.js";import{S as ne}from"./Seo-C5o3G09H.js";import{F as ie}from"./filter-CpkFY5ot.js";import"./index-jpYvqM6k.js";import"./chevron-up-B7XSSgE4.js";import"./circle-check-Bskdbvt1.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 oe=O("ChevronLeft",[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]]);/**
7 * @license lucide-react v0.462.0 - ISC
8 *
9 * This source code is licensed under the ISC license.
10 * See the LICENSE file in the root directory of this source tree.
11 */const le=O("Ellipsis",[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]]),I=({className:s,...a})=>e.jsx("nav",{role:"navigation","aria-label":"pagination",className:h("mx-auto flex w-full justify-center",s),...a}
11);I.displayName="Pagination";const T=p.forwardRef(({className:s,...a},l)=>e.jsx("ul",{ref:l,className:h("flex flex-row items-center gap-1",s),...a}));T.displayName="PaginationContent";const v=p.forwardRef(({className:s,...a},l)=>e.jsx("li",{ref:l,className:h("",s),...a}));v.displayName="PaginationItem";const P=({className:s,isActive:a,size:l="icon",...c})=>e.jsx("a",{"aria-current":a?"page":void 0,className:h($({variant:a?"outline":"ghost",size:l}),s),...c});P.displayName="PaginationLink";const R=({className:s,...a})=>e.jsxs(P,{"aria-label":"Go to previous page",size:"default",className:h("gap-1 pl-2.5",s),...a,children:[e.jsx(oe,{className:"h-4 w-4"}),e.jsx("span",{children:"Previous"})]});R.displayName="PaginationPrevious";const G=({className:s,...a})=>e.jsxs(P,{"aria-label":"Go to next page",size:"default",className:h("gap-1 pr-2.5",s),...a,children:[e.jsx("span",{children:"Next"}),e.jsx(D,{className:"h-4 w-4"})]});G.displayName="PaginationNext";const V=({className:s,...a})=>e.jsxs("span",{"aria-hidden":!0,className:h("flex h-9 w-9 items-center justify-center",s),...a,children:[e.jsx(le,{className:"h-4 w-4"}),e.jsx("span",{className:"sr-only",children:"More pages"})]});V.displayName="PaginationEllipsis";function ce({currentPage:s,totalPages:a,pageNumbers:l,hasNextPage:c,hasPreviousPage:g,onPageChange:r,totalItems:i,startIndex:n,endIndex:x,showItemCount:o=!0}){return a<=1?null:e.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4 mt-8",children:[o&&i!==void 0&&n!==void 0&&x!==void 0&&e.jsxs("p",{className:"text-sm text-muted-foreground",children:["Showing ",n+1,"-",x," of ",i," items"]}),e.jsx(I,{className:o?"":"mx-auto",children:e.jsxs(T,{children:[e.jsx(v,{children:e.jsx(R,{onClick:()=>g&&r(s-1),className:g?"cursor-pointer":"pointer-events-none opacity-50"})}),l.map((d,t)=>e.jsx(v,{children:d===-1?e.jsx(V,{}):e.jsx(P,{onClick:()=>r(d),isActive:d===s,className:"cursor-pointer",children:d})},`page-${t}`)),e.jsx(v,{children:e.jsx(G,{onClick:()=>c&&r(s+1),className:c?"cursor-pointer":"pointer-events-none opacity-50"})})]})})]})}function me({totalItems:s,itemsPerPage:a=12,initialPage:l=1}){const[c,g]=p.useState(l),r=Math.ceil(s/a),i=Math.min(Math.max(1,c),Math.max(1,r)),n=(i-1)*a,x=Math.min(n+a,s),o=i<r,d=i>1,t=m=>{const E=Math.min(Math.max(1,m),r);g(E),window.scrollTo({top:0,behavior:"smooth"})},f=()=>{o&&t(i+1)},j=()=>{d&&t(i-1)},q=m=>m.slice(n,x),B=p.useMemo(()=>{const m=[];if(r<=5)for(let u=1;u<=r;u++)m.push(u);else{m.push(1);let u=Math.max(2,i-1),w=Math.min(r-1,i+1);i<=3&&(w=4),i>=r-2&&(u=r-3),u>2&&m.push(-1);for(let b=u;b<=w;b++)m.push(b);w<r-1&&m.push(-1),m.push(r)}return m},[r,i]);return{currentPage:i,totalPages:r,itemsPerPage:a,startIndex:n,endIndex:x,hasNextPage:o,hasPreviousPage:d,goToPage:t,nextPage:f,previousPage:j,paginateItems:q,pageNumbers:B}}const de={cooperative:"Cooperative",social_enterprise:"Social Enterprise",ngo:"NGO",government:"Government",academic:"Academic",private_sector:"Private Sector",multilateral:"Multilateral",other:"Other"};function xe({org:s}){const a=ae(s.logo_url),l=!s.created_by;return e.jsxs(L,{className:"h-full card-interactive group overflow-hidden",children:[e.jsxs("div",{className:"relative flex items-center justify-center bg-muted/40 border-b p-6 min-h-[140px]",children:[a?e.jsx("img",{src:a,alt:s.name,className:"max-h-24 max-w-[80%] object-contain transition-transform duration-300 group-hover:scale-105"}):e.jsx("div",{className:"flex h-24 w-24 items-center justify-center rounded-2xl bg-primary/10",children:e.jsx(S,{className:"h-12 w-12 text-primary"})}),e.jsxs("div",{className:"absolute top-3 right-3 flex items-center gap-1.5",children:[l&&e.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 text-xs font-medium rounded-full bg-background/80 backdrop-blur text-muted-foreground border",children:[e.jsx(te,{className:"h-3 w-3"}),"Sample"]}),e.jsx(Z,{level:s.verification_level})]})]}),e.jsxs(M,{className:"p-5 space-y-3",children:[e.jsxs("div",{children:[e.jsx("h3",{className:"font-semibold text-base leading-tight line-clamp-2 group-hover:text-primary transition-colors",children:s.name}),e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2 mt-1",children:s.description})]}),e.jsxs("div",{className:"flex items-center gap-3 text-sm text-muted-foreground",children:[e.jsxs("div",{className:"flex items-center gap-1.5",children:[e.jsx(se,{country:s.country,size:"md"}),e.jsx("span",{children:s.country})]}),e.jsx("span",{className:"text-xs bg-muted px-2 py-0.5 rounded-full font-medium",children:de[s.org_type]})]}),s.sdg_tags&&s.sdg_tags.length>0&&e.jsx(ee,{sdgs:s.sdg_tags,max:6}),s.resources_offered&&s.resources_offered.length>0&&e.jsxs("div",{className:"text-xs text-muted-foreground",children:[e.jsx("span",{className:"font-medium",children:"Offers:"})," ",s.resources_offered.slice(0,3).join(", "),s.resources_offered.length>3&&` +${s.resources_offered.length-3} more`]}),l?e.jsx(y,{variant:"outline",size:"sm",className:"w-full mt-1",asChild:!0,children:e.jsxs(C,{to:"/partners/register",children:[e.jsx(F,{className:"mr-2 h-3 w-3"}),"Register Your Organization"]})}):s.website?e.jsx(y,{variant:"outline",size:"sm",className:"w-full mt-1",asChild:!0,children:e.jsxs("a",{href:s.website,target:"_blank",rel:"noopener noreferrer",children:[e.jsx(Q,{className:"mr-2 h-3 w-3"}),"Visit Website"]})}):null]})]})}const ue={cooperative:"Cooperative",social_enterprise:"Social Enterprise",ngo:"NGO",government:"Government",academic:"Academic",private_sector:"Private Sector",multilateral:"Multilateral",other:"Other"};function ze(){const{user:s}
11=H(),[a,l]=p.useState("all"),[c,g]=p.useState("all"),[r,i]=p.useState(""),{data:n,isLoading:x}=U({queryKey:["organizations",a,c,r],queryFn:async()=>{let t=K.from("organizations").select("*").eq("is_approved",!0).order("name");a!=="all"&&(t=t.eq("org_type",a)),c!=="all"&&(t=t.eq("country",c)),r&&(t=t.ilike("name",`%${r}%`));const{data:f,error:j}=await t;if(j)throw j;return f}}),o=me({totalItems:(n==null?void 0:n.length)||0,itemsPerPage:12}),d=o.paginateItems(n||[]);return x?e.jsx(Y,{message:"Loading partners..."}):e.jsxs("div",{children:[e.jsx(ne,{title:"Partner Directory — ASEAN SDG-SSE",description:"Connect with Social and Solidarity Economy organizations, cooperatives, and NGOs across the 11 ASEAN nations.",path:"/partners"}),e.jsx(W,{title:"Partner Directory",description:"Connect with SSE organizations across the ASEAN region",actions:e.jsx(y,{asChild:!0,children:e.jsxs(C,{to:"/partners/register",children:[e.jsx(F,{className:"mr-2 h-4 w-4"}),"Register Organization"]})})}),e.jsxs("div",{className:"container-wide py-8",children:[e.jsxs("div",{className:"mb-6 flex flex-wrap items-center gap-4",children:[e.jsx("div",{className:"flex items-center gap-2",children:e.jsx(ie,{className:"h-4 w-4 text-muted-foreground"})}),e.jsx(J,{placeholder:"Search organizations...",value:r,onChange:t=>i(t.target.value),className:"w-full sm:w-64"}),e.jsxs(_,{value:a,onValueChange:l,children:[e.jsx(A,{className:"w-[180px]",children:e.jsx(k,{placeholder:"Organization Type"})}),e.jsxs(z,{children:[e.jsx(N,{value:"all",children:"All Types"}),Object.entries(ue).map(([t,f])=>e.jsx(N,{value:t,children:f},t))]})]}),e.jsxs(_,{value:c,onValueChange:g,children:[e.jsx(A,{className:"w-[160px]",children:e.jsx(k,{placeholder:"Country"})}),e.jsxs(z,{children:[e.jsx(N,{value:"all",children:"All Countries"}),re.map(t=>e.jsx(N,{value:t,children:t},t))]})]})]}),e.jsxs("p",{className:"mb-4 text-sm text-muted-foreground",children:[(n==null?void 0:n.length)||0," organizations found"]}),d.length>0?e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid gap-6 md:grid-cols-2 lg:grid-cols-3",children:d.map(t=>e.jsx(xe,{org:t},t.id))}),e.jsx(ce,{currentPage:o.currentPage,totalPages:o.totalPages,pageNumbers:o.pageNumbers,hasNextPage:o.hasNextPage,hasPreviousPage:o.hasPreviousPage,onPageChange:o.goToPage,totalItems:n==null?void 0:n.length,startIndex:o.startIndex,endIndex:o.endIndex})]}):e.jsx(X,{icon:S,title:"No organizations found",description:c!=="all"?`Be the first organization from ${c} to join our network!`:"Register your organization to connect with partners across ASEAN.",action:{label:"Register Organization",href:"/partners/register"}}),!s&&e.jsx(L,{className:"mt-8 text-center",children:e.jsxs(M,{className:"py-8",children:[e.jsx(S,{className:"h-12 w-12 mx-auto text-primary mb-4"}),e.jsx("h3",{className:"text-xl font-semibold mb-2",children:"Register Your Organization"}),e.jsx("p",{className:"text-muted-foreground mb-4 max-w-md mx-auto",children:"Create an account to register your organization and connect with partners across ASEAN."}),e.jsx(y,{asChild:!0,children:e.jsx(C,{to:"/auth?mode=signup",children:"Create Account"})})]})})]})]})}export{ze 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.