1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[5013],{3978:(e,t,s)=>{"use strict";s.r(t),s.d(t,{__N_SSP:()=>f,default:()=>h});var n=s(37876),r=s(14232),l=s(96145),a=s(84768),i=s(81220),u=s(89099);let c=e=>{var t,s;let{trendingPosts:c}=e,[o,d]=(0,r.useState)(c),[f,h]=(0,r.useState)((null==c?void 0:c.length)||0),[x]=(0,r.useState)(10),[g,v]=(0,r.useState)(!1),[_,j]=(0,r.useState)(!0),[p,m]=(0,r.useState)(!1),y=(0,r.useRef)(null),N=(0,u.useRouter)(),w=null==N||null==(s=N.query)||null==(t=s.slug)?void 0:t[0],E=(0,r.useCallback)(async()=>{if(!g&&_){v(!0);try{var e;let t=await (0,i.hR)({offset:f,limit:x,search:"#".concat(w)}),s=(null==t||null==(e=t.content)?void 0:e.posts)||[];s.length>0?(d(e=>[...e,...s]),h(e=>e+x),j(s.length===x)):j(!1)}catch(e){console.error("Error loading For You posts",e)}finally{v(!1)}}},[f,x,_,g,w]);return(0,r.useEffect)(()=>{if(!_||g)return;let e=new IntersectionObserver(t=>{t[0].isIntersecting&&(E(),e.disconnect())}),t=y.current;return t&&e.observe(t),()=>{t&&e.unobserve(t)}},[E,_,g]),(0,r.useEffect)(()=>{if(!_&&!g){m(!0);let e=setTimeout(()=>m(!1),3e3);return()=>clearTimeout(e)}},[_,g]),(0,n.jsxs)("div",{className:"space-y-5 p-5",children:[o.length>0?o.map(e=>(0,n.jsx)(a.A,{postData:e},e.id)):(0,n.jsx)("div",{className:"text-center text-14 text-grey",children:"No new posts in your feed!!"}),g&&(0,n.jsx)("div",{className:"flex justify-center text-center text-gray-500 py-3",children:(0,n.jsx)(l.aH,{className:"text-primary"})}),_&&(0,n.jsx)("div",{ref:y,className:"h-10"}),p&&(0,n.jsx)("div",{className:"text-center text-gray-400 text-sm py-4 animate-fade-in",children:"Youâve reached the end of the feed!"})]})};var o=s(42489),d=s(80612),f=!0;function h(e){let{userDetails:t,posts:s,suggestionList:r,tagsList:l}=e;return(0,n.jsxs)(n.Fragment,{children:[(0,n.jsx)(d.A,{title:"Trending"}),(0,n.jsx)(o.A,{userDetails:t,suggestionList:r,tagsList:l,children:(0,n.jsx)(c,{trendingPosts:s})})]})}},80612:(e,t,s)=>{"use strict";s.d(t,{A:()=>a});var n=s(37876),r=s(77328),l=s.n(r);function a(e){let{title:t}=e;return(0,n.jsx)(l(),{children:(0,n.jsx)("title",{children:t?"".concat(t," | Velaflow"):"Velaflow"})})}},83390:(e,t,s)=>{(window.__NEXT_P=window.__NEXT_P||[]).push(["/trending/[...slug]",function(){return s(3978)}])}},e=>{e.O(0,[3716,4668,9634,2489,3433,4768,636,6593,8792],()=>e(e.s=83390)),_N_E=e.O()}]);
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.