1"use strict";(globalThis.webpackChunkhive_postify_client||=[]).push([[4110],{5217(e,s,a){a(9950);var l=a(4414);const t=()=>(0,l.jsxs)("div",{className:"card p-6 mb-4",children:[(0,l.jsxs)("div",{className:"flex items-center space-x-4",children:[(0,l.jsx)("div",{className:"skeleton w-16 h-16 rounded-xl flex-shrink-0"}),(0,l.jsxs)("div",{className:"flex-1 space-y-2",children:[(0,l.jsx)("div",{className:"skeleton h-5 w-48 rounded"}),(0,l.jsx)("div",{className:"skeleton h-4 w-32 rounded"})]}),(0,l.jsx)("div",{className:"skeleton h-10 w-28 rounded-full"})]}),(0,l.jsxs)("div",{className:"mt-4 space-y-2",children:[(0,l.jsx)("div",{className:"skeleton h-4 w-full rounded"}),(0,l.jsx)("div",{className:"skeleton h-4 w-3/4 rounded"})]})]});a.d(s,["H",0,e=>{let{count:s=5}=e;return(0,l.jsx)(l.Fragment,{children:Array.from({length:s}).map((e,s)=>(0,l.jsx)(t,{},s))})}])},4110(e,s,a){a.r(s);var l=a(9950),t=a(2074),n=a(4853),o=a(8520),i=a(7737),r=a(1654),d=a(6624),c=a(6890),m=a(1064),u=a(9975),x=a(2857),h=(a(5217),a(4414));const g=()=>{const{user:e,isAuthenticated:s}=(0,o.useAuthStore)(),[a,g]=(0,l.useState)("trending"),[p,b]=(0,l.useState)("communities"),[y,f]=(0,l.useState)([]),[j,w]=(0,l.useState)([]),[v,N]=(0,l.useState)(!0);(0,l.useEffect)(()=>{null!==e&&void 0!==e&&e.username&&k()},[null===e||void 0===e?void 0:e.username]);const k=async()=>{try{N(!0);const s=await x.B.getSubscriptions(e.username);console.log("\ud83d\udccb Subscriptions loaded:",s),f(s);const a=await Promise.all(s.map(e=>x.B.getCommunity(e[0])));console.log("\ud83c\udfd8\ufe0f Community details loaded:",a),w(a)}catch(s){console.error("Error loading subscriptions:",s)}finally{N(!1)}},A=(null===e||void 0===e?void 0:e.username)||"",C=y.map(e=>e[0]).join(",");if(console.log("\ud83c\udff7\ufe0f Community tags:",C),!s)return(0,h.jsx)("div",{className:"max-w-3xl mx-auto",children:(0,h.jsxs)("div",{className:"card p-12 text-center",children:[(0,h.jsx)("h2",{className:"text-2xl font-bold mb-4",children:"Login Required"}),(0,h.jsx)("p",{className:"text-gray-600 dark:text-gray-400",children:"Please login to view your personalized feed"})]})});const S=[{id:"trending",label:"Trending",icon:c.A},{id:"hot",label:"Hot",icon:d.A},{id:"created",label:"New",icon:i.A},{id:"muted",label:"Muted",icon:r.A}];return(0,h.jsxs)("div",{className:"max-w-3xl mx-auto",children:[(0,h.jsxs)("div",{className:"mb-6",children:[(0,h.jsx)("h1",{className:"text-3xl font-bold mb-2",children:"My Feed"}),(0,h.jsx)("p",{className:"text-gray-600 dark:text-gray-400",children:"following"===p?"Posts from people you follow":"Posts from your subscribed communities"})]}),(0,h.jsxs)("div",{className:"flex space-x-2 mb-4",children:[(0,h.jsxs)("button",{onClick:()=>b("communities"),className:`\n flex items-center space-x-2 px-4 py-2 rounded-full font-medium transition-all whitespace-nowrap\n ${"communities"===p?"bg-primary-500 text-white":"bg-gray-200 dark:bg-dark-700 hover:bg-gray-300 dark:hover:bg-dark-600"}\n `,children:[(0,h.jsx)(u.A,{className:"w-4 h-4"}),(0,h.jsx)("span",{children:"My communities"})]}),(0,h.jsxs)("button",{onClick:()=>b("following"),className:`\n flex items-center space-x-2 px-4 py-2 rounded-full font-medium transition-all whitespace-nowrap\n ${"following"===p?"bg-primary-500 text-white":"bg-gray-200 dark:bg-dark-700 hover:bg-gray-300 dark:hover:bg-dark-600"}\n `,children:[(0,h.jsx)(m.A,{className:"w-4 h-4"}),(0,h.jsx)("span",{children:"People you follow"})]})]}),(0,h.jsx)("div",{className:"flex space-x-2 mb-6 overflow-x-auto scrollbar-hide",children:S.map(e=>{const s=e.icon;return(0,h.jsxs)("button",{onClick:()=>g(e.id),className:`\n flex items-center space-x-2 px-4 py-2 rounded-full font-medium transition-all whitespace-nowrap\n ${a===e.id?"bg-primary-500 text-white":"bg-gray-200 dark:bg-dark-700 hover:bg-gray-300 dark:hover:bg-dark-600"}\n `,children:[(0,h.jsx)(s,{className:"w-4 h-4"}),(0,h.jsx)("span",{children:e.label})]},e.id)})}),"following"===p?(console.log("\ud83d\udcca People you follow: query","muted"===a?"muted":"feed","tag",A),(0,h.jsx)(n.A,{query:"muted"===a?"muted":"feed",tag:A,clientSort:"muted"===a?null:a},`following-${a}`)):0===y.length?(0,h.jsxs)("div",{className:"card p-12 text-center",children:[(0,h.jsx)("h2",{className:"text-2xl font-bold mb-4",children:"No Communities Joined"}),(0,h.jsx)("p",{className:"text-gray-600 dark:text-gray-400 mb-4",children:"Join some communities to see posts here!"}),(0,h.jsx)(t.N_,{to:"/communities",className:"btn-primary",children:"Browse Communities"})]}):(console.log("\ud83d\udcca My communities: query",a,"tag",C),(0,h.jsx)(n.A,{query:a,tag:C},`communities-${a}`))]})};a.d(s,["default",0,g])}}]);
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.