(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[8698],{22828:function(e,s,t){(window.__NEXT_P=window.__NEXT_P||[]).push(["/user/[user]/activity",function(){return t(88046)}])},15535:function(e,s,t){"use strict";var r=t(85893);t(67294);var i=t(32121),n=t(88287);s.Z=e=>{let{type:s}=e,t=[0,1,2,3,4,5,6,7,8,9];return"news"===s?t.map((e,s)=>(0,r.jsx)("div",{className:"mb-3",children:(0,r.jsx)(i.Z,{children:(0,r.jsx)(i.Z.Body,{children:(0,r.jsxs)("div",{className:"d-flex",children:[(0,r.jsx)("div",{className:"bg-light border rounded me-3 bg-placeholder",style:{width:"100px",height:"5rem"}}),(0,r.jsx)("div",{style:{width:"100%",marginLeft:"5px"},children:(0,r.jsx)("div",{className:"bg-light border rounded bg-placeholder",style:{width:"100%",height:"5rem",marginBottom:"5px"}})})]})})})},s)):"activity"===s?(0,r.jsx)(r.Fragment,{children:(0,r.jsx)(n.Z,{bordered:!0,responsive:!0,children:(0,r.jsx)("tbody",{children:t.map((e,s)=>(0,r.jsx)("tr",{children:(0,r.jsx)("td",{children:(0,r.jsxs)("div",{className:"d-flex",children:[(0,r.jsx)("div",{className:"bg-light border rounded me-3 bg-placeholder",style:{width:"42px",height:"35px"}}),(0,r.jsxs)("div",{style:{width:"100%",marginLeft:"10px"},children:[(0,r.jsx)("div",{className:"bg-light border rounded bg-placeholder",style:{width:"60%",height:"1rem",marginBottom:"8px"}}),(0,r.jsx)("div",{className:"bg-light border rounded bg-placeholder",style:{width:"100%",height:"5rem",marginBottom:"8px"}}),(0,r.jsx)("div",{className:"bg-light border rounded bg-placeholder",style:{width:"75%",height:"1rem"}})]})]})})},s))})})}):void 0}},18748:function(e,s,t){"use strict";var r=t(85893),i=t(67294),n=t(36333),a=t(10610),c=t(76720),l=t(70525),o=t(11163);s.Z=e=>{let{activities:s,setRefresh:t,refresh:d,setPostNum:h,status:u,activityFilterMap:m,type:x,loggedInUserId:j}=e,g=(0,o.useRouter)(),[f,p]=(0,i.useState)(s),[v,y]=(0,i.useState)(10);async function w(e){if(e.preventDefault(),m[x].isWidget)g.push("/");else{let e=await (0,a.qF)(m[x].userId,parseInt(v+10),m[x].last,m[x].type,m[x].displayComments,m[x].scope);e&&(p(e),y(parseInt(v)+10),h(parseInt(v)+10))}}return(0,i.useEffect)(()=>{p(s)},[s]),(0,r.jsxs)("div",{children:[f.nodes.filter(e=>null!==e.creator).map(e=>(0,r.jsx)(n.Z,{userid:m[x].userId,activity:e,setRefresh:t,refresh:d,status:u,comments:{primary:2,secondary:1,rows:1,type:"short"},loggedInUserId:j},e.databaseId)),f.pageInfo.hasNextPage&&(0,r.jsx)(c.Z,{variant:"dark",size:"lg",onClick:w,children:"Load More..."}),!f.nodes.length&&(0,r.jsx)(l.Z,{variant:"info",children:"No activity found!"})]})}},79549:function(e,s,t){"use strict";t.d(s,{Z:function(){return g}});var r=t(85893),i=t(32121),n=t(3106),a=t(67814),c=t(93024),l=t(41664),o=t.n(l),d=t(11163),h=t(67294),u=t(10610),m=t(76720),x=t(59417),j=e=>{let{userDetails:s,session:t,status:i}=e,[n,c]=(0,h.useState)(s),[l,o]=(0,h.useState)("loading"),[j,g]=(0,h.useState)(!1),[f,p]=(0,h.useState)(0),v=(0,d.useRouter)();async function y(e){e.preventDefault();(l?await (0,u.wQ)(n.id):await (0,u.P_)(n.id))&&(o(!l),g(!j),p(!f))}if((0,h.useEffect)(()=>{"authenticated"===i?(0,u.MV)(t.user.id,n.id).then(e=>{e&&(o(e.isFollowing),g(e.notify))}):"unauthenticated"===i&&(o(!1),g(!1))},[i]),(0,h.useEffect)(()=>{(0,u.PR)(v.query.user).then(e=>{c(s=>({...s,...e}))})},[f]),"loading"===l)return(0,r.jsx)(m.Z,{variant:"light",size:"sm",children:"Loading..."});{let e=JSON.parse(n.followCount);return(0,r.jsxs)(r.Fragment,{children:[t&&s.id!==t.user.id&&(0,r.jsx)(m.Z,{size:"sm",variant:"dark",onClick:y,children:l?(0,r.jsxs)("span",{children:[(0,r.jsx)(a.G,{icon:x.hkK})," Following"]}):(0,r.jsxs)("span",{children:[(0,r.jsx)(a.G,{icon:x.FKd})," Follow"]})}),(0,r.jsxs)("small",{className:"d-block mt-2 mb-2",children:[(0,r.jsx)("strong",{children:e.followers}),(0,r.jsx)("span",{className:"ms-1",children:"Followers"}),(0,r.jsx)("strong",{className:"ms-2",children:e.following}),(0,r.jsx)("span",{className:"ms-1",children:"Following"})]})]})}},g=e=>{let{user:s,status:t,session:l}=e,{query:h}=(0,d.useRouter)();return(0,r.jsxs)(i.Z,{className:"mb-4",children:[(0,r.jsx)("div",{className:"bg-light-subtle text-center pb-4 border-bottom",children:(0,r.jsx)("img",{style:{margin:"0 auto"},className:"rounded mt-4",height:150,width:150,src:s.avatar.url,alt:s.name})}),(0,r.jsxs)(i.Z.Body,{className:"text-center",children:[(0,r.jsxs)("span",{children:["@",s.username]}),(0,r.jsx)(i.Z.Title,{children:(0,r.jsx)("h3",{children:s.name})}),(0,r.jsx)(i.Z.Text,{className:"text-secondary",children:"null"!==s.description?s.description:""}),(0,r.jsx)("div",{className:"text-center",children:(0,r.jsx)(j,{userDetails:s,status:t,session:l})}),(0,r.jsxs)(i.Z.Text,{className:"h5 mb-2 mt-3",children:[s.twitter&&(0,r.jsx)("a",{className:"p-1",href:"https://twitter.com/".concat(s.twitter),rel:"no-follow",children:(0,r.jsx)(a.G,{icon:c.mdU})}),s.instagram&&(0,r.jsx)("a",{className:"p-2",href:"https://www.instagram.com/".concat(s.instagram,"/"),rel:"no-follow",children:(0,r.jsx)(a.G,{icon:c.Zzi})}),s.facebook&&(0,r.jsx)("a",{className:"p-1",href:"https://www.facebook.com/".concat(s.facebook,"/"),rel:"no-follow",children:(0,r.jsx)(a.G,{icon:c.neY})}),s.youtube&&(0,r.jsx)("a",{className:"p-1 text-danger",href:"https://www.youtube.com/channel/".concat(s.youtube),rel:"no-follow",children:(0,r.jsx)(a.G,{icon:c.opf})})]})]}),(0,r.jsxs)(n.Z,{className:"list-group-flush",children:[(0,r.jsx)(n.Z.Item,{children:(0,r.jsx)(o(),{legacyBehavior:!0,href:"/user/".concat(h.user,"/activity"),children:"Activity"})}),(0,r.jsx)(n.Z.Item,{children:(0,r.jsx)(o(),{legacyBehavior:!0,href:"/user/".concat(h.user,"/comments"),children:"Comments"})}),(0,r.jsx)(n.Z.Item,{children:(0,r.jsx)(o(),{legacyBehavior:!0,href:"/user/".concat(h.user,"/followers"),children:"Followers"})}),(0,r.jsx)(n.Z.Item,{children:(0,r.jsx)(o(),{legacyBehavior:!0,href:"/user/".concat(h.user,"/following"),children:"Following"})}),"authenticated"===t&&s.id===l.user.id?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(n.Z.Item,{children:(0,r.jsx)(o(),{legacyBehavior:!0,href:"/user/".concat(h.user,"/notifications"),children:"Notifications"})}),(0,r.jsx)(n.Z.Item,{children:(0,r.jsx)(o(),{legacyBehavior:!0,href:"/user/".concat(h.user,"/edit-profile"),children:"Edit Profile"})}),(0,r.jsx)(n.Z.Item,{children:(0,r.jsx)(o(),{legacyBehavior:!0,href:"/user/".concat(h.user,"/setting"),children:"Account Setting"})})]}):""]})]})}},88287:function(e,s,t){"use strict";var r=t(93967),i=t.n(r),n=t(67294),a=t(97400),c=t(85893);let l=n.forwardRef((e,s)=>{let{bsPrefix:t,className:r,striped:n,bordered:l,borderless:o,hover:d,size:h,variant:u,responsive:m,...x}=e,j=(0,a.vE)(t,"table"),g=i()(r,j,u&&"".concat(j,"-").concat(u),h&&"".concat(j,"-").concat(h),n&&"".concat(j,"-").concat("string"==typeof n?"striped-".concat(n):"striped"),l&&"".concat(j,"-bordered"),o&&"".concat(j,"-borderless"),d&&"".concat(j,"-hover")),f=(0,c.jsx)("table",{...x,className:g,ref:s});if(m){let e="".concat(j,"-responsive");return"string"==typeof m&&(e="".concat(e,"-").concat(m)),(0,c.jsx)("div",{className:e,children:f})}return f});s.Z=l},88046:function(e,s,t){"use strict";t.r(s),t.d(s,{__N_SSP:function(){return v}});var r=t(85893),i=t(67294),n=t(11163),a=t(15814),c=t(10610),l=t(19101),o=t(68070),d=t(33299),h=t(15535),u=t(76571),m=t(79549),x=t(18748),j=t(9008),g=t.n(j),f=t(12918),p=t.n(f),v=!0;s.default=e=>{var s;let{userData:t,content:j}=e,{data:f,status:v}=(0,d.useSession)(),y=(0,n.useRouter)(),[w,b]=(0,i.useState)(10),[N,Z]=(0,i.useState)(!1),[I,_]=(0,i.useState)(j),F="Everything",E={Everything:{userId:t.userId,first:w,last:0,type:"[ACTIVITY_UPDATE]",displayComments:!1,scope:"[]"}};return((0,i.useEffect)(()=>{"authenticated"===v&&(0,c.qF)(E[F].userId,E[F].first,E[F].last,E[F].type,E[F].displayComments,E[F].scope).then(e=>{_(e)})},[N,w]),t)?(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(u.Z,{data:{title:"Activity "+(t.name||"User"),description:t.description||"A member of defiadda community",path:"/user/".concat(y.query.user)}}),(0,r.jsx)(a.Z,{style:{marginTop:40},children:(0,r.jsxs)(l.Z,{children:[(0,r.jsx)(o.Z,{md:4,lg:{order:1},children:(0,r.jsx)(m.Z,{user:t,session:f,status:v})}),(0,r.jsxs)(o.Z,{md:8,children:[(0,r.jsx)("h2",{className:"mb-3",children:"Activity"}),j.nodes.length?"loading"===v?(0,r.jsx)(h.Z,{}):(0,r.jsx)(x.Z,{status:v,userid:t.userId,activities:I,setPostNum:b,postNum:w,activityFilterMap:E,type:"Everything",loggedInUserId:null==f?void 0:null===(s=f.user)||void 0===s?void 0:s.userId,setRefresh:Z,refresh:N}):"No activity found!"]})]})})]}):(0,r.jsxs)(r.Fragment,{children:[(0,r.jsx)(g(),{children:(0,r.jsx)("meta",{name:"robots",content:"noindex"})}),(0,r.jsx)(p(),{statusCode:404})]})}},12918:function(e,s,t){e.exports=t(2111)}},function(e){e.O(0,[7948,6943,4659,5814,3802,2888,9774,179],function(){return e(e.s=22828)}),_N_E=e.O()}]);