(self.webpackChunk_studyhub_co_react_comments_django_client=self.webpackChunk_studyhub_co_react_comments_django_client||[]).push([[3967],{73967:(t,e,o)=>{"use strict";o.r(e),o.d(e,{TopicsList:()=>F,default:()=>V,mapDispatchToProps:()=>K});var n,r,i,c=o(67294),a=(o(45697),o(15482)),s=o(99095),l=o(37424),u=o(246),d=o.n(u),f=o(35281),p=o(22222),m=o(18350),v=o.n(m),y=o(85809),h=o(28269),b=o.n(h),g=o(1266),S=o.n(g),_=o(70448),w=o.n(_),A=o(71893);function C(t,e,o,n){i||(i="function"===typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103);var r=t&&t.defaultProps,c=arguments.length-3;if(e||0===c||(e={children:void 0}),1===c)e.children=n;else if(c>1){for(var a=new Array(c),s=0;s<c;s++)a[s]=arguments[s+3];e.children=a}if(e&&r)for(var l in r)void 0===e[l]&&(e[l]=r[l]);else e||(e=r||{});return{$$typeof:i,type:t,key:void 0===o?null:""+o,ref:null,props:e,_owner:null}}var L=A.ZP.div.withConfig({displayName:"TopicListItem__CounterText",componentId:"sc-9of5q8-0"})(["font-size:0.7rem;"]);const k=function(t){return C(v().Item,{action:!0,onClick:t.onClick},void 0,C(w(),{},void 0,C(b(),{},void 0,n||(n=C(S(),{md:1},void 0,C(y.OdJ,{size:32}))),C(S(),{md:10},void 0,C("h4",{},void 0,t.item.title),t.item.description),C(S(),{md:1},void 0,C(L,{},void 0,t.item.threads_counter),r||(r=C(L,{},void 0,"Threads"))))))};var T=o(41293),I=o(92148),j=o(29473),P=o(4828);const Z=A.ZP.section.withConfig({displayName:"Section",componentId:"glq6sp-0"})(["margin:3em auto;&:first-child{margin-top:0;}"]);const x=(0,A.ZP)(Z).withConfig({displayName:"CenteredSection",componentId:"sc-1hnw32i-0"})(["text-align:center;"]);const E=(0,s.vU)({topicsList:{id:"".concat("boilerplate.containers.HomePage",".topics"),defaultMessage:"Topics"}});var O,$,M=o(75010),N=o(41867),q=o(60207),z=o(63963);function B(t,e,o,n){$||($="function"===typeof Symbol&&Symbol.for&&Symbol.for("react.element")||60103);var r=t&&t.defaultProps,i=arguments.length-3;if(e||0===i||(e={children:void 0}),1===i)e.children=n;else if(i>1){for(var c=new Array(i),a=0;a<i;a++)c[a]=arguments[a+3];e.children=c}if(e&&r)for(var s in r)void 0===e[s]&&(e[s]=r[s]);else e||(e=r||{});return{$$typeof:$,type:t,key:void 0===o?null:""+o,ref:null,props:e,_owner:null}}function D(t){return function(t){if(Array.isArray(t))return J(t)}(t)||function(t){if("undefined"!==typeof Symbol&&Symbol.iterator in Object(t))return Array.from(t)}(t)||U(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function H(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"===typeof Symbol||!(Symbol.iterator in Object(t)))return;var o=[],n=!0,r=!1,i=void 0;try{for(var c,a=t[Symbol.iterator]();!(n=(c=a.next()).done)&&(o.push(c.value),!e||o.length!==e);n=!0);}catch(t){r=!0,i=t}finally{try{n||null==a.return||a.return()}finally{if(r)throw i}}return o}(t,e)||U(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function U(t,e){if(t){if("string"===typeof t)return J(t,e);var o=Object.prototype.toString.call(t).slice(8,-1);return"Object"===o&&t.constructor&&(o=t.constructor.name),"Map"===o||"Set"===o?Array.from(t):"Arguments"===o||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(o)?J(t,e):void 0}}function J(t,e){(null==e||e>t.length)&&(e=t.length);for(var o=0,n=new Array(e);o<e;o++)n[o]=t[o];return n}var R="topics";function F(t){var e=t.topicListActions,o=t.topicsList;(0,I.v)({key:R,reducer:N.Z}),(0,j.h)({key:R,saga:q.ZP});var n=H((0,c.useState)([]),2),r=n[0],i=n[1],l=H((0,c.useState)(!1),2),u=l[0],f=l[1],p=H((0,c.useState)(null),2),m=p[0],y=p[1];(0,c.useEffect)((function(){return e.loadTopics(),function(){e.topicsListLoaded(!1)}}),[]);(0,c.useEffect)((function(){o&&(i([].concat(D(r),D(o.results))),f(Boolean(o.next)),y(o.next))}),[o]);var h=[];return r&&(h=r.map((function(t){return B(k,{onClick:function(e){var o;o=t.slug,z.Z.push("/topics/".concat(o))},item:t},t.slug)}))),B("article",{},void 0,O||(O=B(a.q,{},void 0,B("title",{},void 0,"Topics List"),B("meta",{name:"description",content:"React comments Django topics List"}))),B("div",{},void 0,B(x,{},void 0,B(T.Z,{},void 0,c.createElement(s._H,E.topicsList))),B(Z,{},void 0,B(d(),{pageStart:0,loadMore:function(){u&&(f(Boolean(!1)),e.loadTopics(m))},hasMore:u},void 0,B(v(),{},void 0,h)))))}var G=(0,p.zB)({topicsList:(0,P.fN)()});function K(t){return{topicListActions:(0,f.bindActionCreators)(M,t)}}var Q=(0,l.connect)(G,K);const V=(0,f.compose)(Q,c.memo)(F)}}]);