PageSourceSearch

https://bondedpath.com/assets/CommunitiesPage-Qd8-gB9w.js

js bondedpath.com collected 2026-10-02 00:47:36 UTC 5,925 bytes, 1 lines download raw bytes

1import{u as k,r as o,j as e}from"./vendor-react-BoyrKzsG.js";import{u as A,f as U,D as c,o as F,b as O,C as P}from"./index-CKCEYSTE.js";import{g as R,a as T}from"./communityService-CSdb11lr.js";import"./vendor-firebase-DbFCdLkQ.js";import{S as $}from"./SEO-BIqDWYNT.js";/* empty css                        */import{t as v,u as p,o as D,v as H,w as B,D as G,r as l,x as Q}from"./vendor-ui-Cy9YOY35.js";const W=[{id:"all",name:"All",icon:p},{id:"Relationships",name:"Relationships",icon:D},{id:"Mental Health",name:"Mental Health",icon:H},{id:"Career",name:"Career",icon:B},{id:"Finance",name:"Finance",icon:G}],se=()=>{const j=k(),{userProfile:_,user:m,isAdmin:V}=A();U();const[y,S]=o.useState([]),[b,L]=o.useState([]),[w,N]=o.useState(!0),[n,E]=o.useState(""),[r,z]=o.useState("all");o.useEffect(()=>{I()},[m]);const I=async()=>{if(m){N(!0);try{const[s,i]=await Promise.all([R({limit:100}),T(m.uid)]);S(s),L(i)}catch(s){console.error("Error loading communities:",s)}finally{N(!1)}}},d=s=>{j(`/communities/${s}`)},u=y.filter(s=>{var t;const i=s.name.toLowerCase().includes(n.toLowerCase())||s.description.toLowerCase().includes(n.toLowerCase()),a=r==="all"||((t=s.category)==null?void 0:t.struggleCategory)===r;return i&&a}),g=b.filter(s=>{var t;const i=s.name.toLowerCase().includes(n.toLowerCase())||s.description.toLowerCase().includes(n.toLowerCase()),a=r==="all"||((t=s.category)==null?void 0:t.struggleCategory)===r;return i&&a}),M=c.map(s=>s.id),h=n.trim()!=="",C=h?[]:u.filter(s=>{var i;return(i=c.find(a=>a.id===s.id))==null?void 0:i.isFeatured}),f=h?u:u.filter(s=>{var i;return M.includes(s.id)&&!((i=c.find(a=>a.id===s.id))!=null&&i.isFeatured)}),x=(s,i=32)=>{const a=c.find(t=>t.id===s);if(a){const t=P[a.icon];return t?e.jsx(t,{size:i,strokeWidth:1.5}):null}return e.jsx(l,{size:i,strokeWidth:1.5})};return w?e.jsx("div",{className:"communities-page",children:e.jsx(F,{message:"Loading communities..."})}):e.jsxs("div",{className:"communities-page",children:[e.jsx($,{title:"Communities",description:"Explore and join supportive communities on BondedPath. Share your experiences in safe, moderated spaces.",url:"https://bondedpath.com/communities"}),e.jsxs("header",{className:"communities-hero",children:[e.jsx("div",{className:"hero-content",children:e.jsx("p",{children:"Safe, non-judgmental spaces to share and heal together."})}),e.jsxs("div",{className:"discovery-controls",children:[e.jsxs("div",{className:"search-wrapper",children:[e.jsx(v,{className:"search-icon",size:20}),e.jsx("input",{type:"text",placeholder:"Find a community (e.g. breakup, stress)...",value:n,onChange:s=>E(s.target.value)})]}),O.subscription.enforceSubscription]}),e.jsx("div",{className:"category-scroll",children:W.map(s=>{const i=s.icon;return e.jsxs("button",{className:`category-pill ${r===s.id?"active":""}`,onClick:()=>z(s.id),children:[e.jsx(i,{size:16}),e.jsx("span",{children:s.name})]},s.id)})})]}),e.jsxs("div",{className:"communities-content",children:[g.length>0&&e.jsxs("section",{className:"my-communities-section",children:[e.jsx("div",{className:"section-header",children:e.jsxs("h2",{className:"section-title",children:[e.jsx(l,{size:20,className:"title-icon"}),"My Communities"]})}),e.jsx("div",{className:"my-communities-scroll",children:g.map(s=>e.jsxs("div",{className:`my-community-card ${c.some(i=>i.id===s.id)?"":"is-user-created"}`,onClick:()=>d(s.id),children:[e.jsx("div",{className:"my-community-icon",children:x(s.id,24)}),e.jsx("span",{className:"my-community-name",children:s.name})]},s.id))})]}),C.length>0&&n===""&&e.jsxs("section",{className:"featured-section",children:[e.jsx("div",{className:"section-header",children:e.jsxs("h2",{className:"section-title",children:[e.jsx(Q,{size:20,className:"title-icon"}),"Featured Communities"]})}),e.jsx("div",{className:"featured-grid",children:C.map(s=>{var i,a;return e.jsxs("div",{className:`featured-card ${c.some(t=>t.id===s.id)?"":"is-user-created"}`,onClick:()=>d(s.id),children:[e.jsx("div",{className:"featured-icon-bg",children:x(s.id,32)}),e.jsxs("div",{className:"featured-info",children:[e.jsxs("div",{className:"card-top",children:[e.jsx("span",{className:"category-tag",children:(i=s.category)==null?void 0:i.struggleCategory}),e.jsxs("span",{className:"member-count",children:[e.jsx(l,{size:12}),((a=s.statistics)==null?void 0:a.memberCount)||0]})]}),e.jsx("h3",{className:"community-name",children:s.name}),e.jsx("p",{className:"community-desc",children:s.description})]})]},s.id)})})]}),e.jsxs("section",{className:"all-communities-section",children:[e.jsxs("h2",{className:"section-title",children:[e.jsx(p,{size:20,className:"title-icon"}),h?"Search Results":"Explore All"]}),e.jsxs("div",{className:"communities-list",children:[f.map(s=>{var i;return e.jsxs("div",{className:`community-list-item ${c.some(a=>a.id===s.id)?"":"is-user-created"}`,onClick:()=>
1d(s.id),children:[e.jsx("div",{className:"item-icon",children:x(s.id,24)}),e.jsxs("div",{className:"item-content",children:[e.jsxs("div",{className:"item-main",children:[e.jsx("h3",{className:"item-name",children:s.name}),e.jsxs("span",{className:"member-badge",children:[e.jsx(l,{size:12}),((i=s.statistics)==null?void 0:i.memberCount)||0]})]}),e.jsx("p",{className:"item-description",children:s.description})]})]},s.id)}),f.length===0&&e.jsxs("div",{className:"empty-results",children:[e.jsx(v,{size:40,className:"empty-icon"}),e.jsxs("p",{children:['No communities found matching "',n,'"']})]}),n===""&&r==="all"&&e.jsxs("div",{className:"community-list-item discover-more",onClick:()=>j("/communities/user-created/"),children:[e.jsx("div",{className:"item-icon user-created-icon",children:e.jsx(p,{size:28})}),e.jsxs("div",{className:"item-content",children:[e.jsx("h3",{className:"item-name",children:"User Created Groups"}),e.jsx("p",{className:"item-description",children:"Explore communities built by our amazing members"})]})]})]})]})]})]})};export{se 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.