1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[6105],{6161:function(e,t,n){(window.__NEXT_P=window.__NEXT_P||[]).push(["/circle/[feeds]",function(){return n(16642)}])},16642:function(e,t,n){"use strict";n.r(t),n.d(t,{__N_SSP:function(){return y}});var a=n(85893),i=n(9008),s=n.n(i),r=n(25675),c=n.n(r),o=n(11163),_=n(65885),l=n(67294),d=n(33828),u=n.n(d),m=n(35756),h=n(1700),f=n(45527),p=n(85161),g=n(75914),x=n(27726),b=n(52670),j=n(99086);n(19657);var v=n(2947);n(64213);let N=e=>{let{circleDetail:t}=e,n=new _.Z,i=n.get("access_token"),r=(0,o.useRouter)(),{feeds:d}=r.query,N=(0,l.useRef)(null),y=(0,l.useRef)([]),[w,k]=(0,l.useState)(null),[C,S]=(0,l.useState)(""),[P,R]=(0,l.useState)(!1),[Z,A]=(0,l.useState)(null),{data:E,fetchNextPage:M,isFetchingNextPage:I,hasNextPage:L}=(0,p.Z)(d),O=(0,l.useCallback)(async()=>{await M()},[M]),T=async e=>{if(e.preventDefault(),!i){r.push("/login");return}R(!0);try{if(""===C.trim()){v.Am.warning("Can't be empty!"),R(!1);return}if(!/^[a-zA-Z0-9 .,!?\&<>]+$/.test(C)){v.Am.warning("Invalid input. Please enter only letters, numbers, spaces, and allowed punctuation: .,!?&<>."),R(!1);return}let t={content_post_circle:C,images:y.current},n=await fetch(h.f+"/api/v1/circle/post/".concat(d),{method:"POST",headers:{accept:"application/json",Authorization:"Bearer ".concat(i),"Content-Type":"application/json"},body:JSON.stringify(t)}),a=await n.json();A(a.data),S(""),k(""),v.Am.success(Z),N.current&&(N.current.value=""),R(!1)}catch(s){console.error(s),R(!1)}},B=e=>{if(!i){r.push("/login");return}S(e.target.value),e.target.style.height="auto",e.target.style.height="".concat(Math.min(e.target.scrollHeight,150),"px")},D=async()=>{if(!i){r.push("/login");return}let e=Array.from(N.current.files),t=e.map(async e=>{let t=URL.createObjectURL(e),n=await (0,f.Z)(t);return{filename:e.name,base64:n,imageUrl:t}});try{let n=await Promise.all(t);y.current=y.current.concat(n),k([...y.current])}catch(a){console.error("Failed to convert images to base64:",a)}},H=e=>{if(!i){r.push("/login");return}let t=[...y.current];t.splice(e,1),y.current=t,k([...t])},z=()=>{if(!i){r.push("/login");return}};return(0,a.jsxs)("div",{className:u().container,children:[(0,a.jsxs)(s(),{children:[(0,a.jsxs)("title",{children:["Seven Hub - Circle ",d," Community, Forum Diskusi Penggemar TRANS7"]}),(0,a.jsx)("meta",{name:"description",content:"Forum diskusi penggemar ".concat(d,". Interaksi dari berbagai komunitas hobi eksklusif.")}),(0,a.jsx)("link",{rel:"canonical",href:"https://sevenhub.id"+r.asPath})]}),(0,a.jsx)(c(),{className:u().banner_image,src:t.data.banner_category_circle||"/",alt:"banner_community",width:0,height:0,loader:m.t,priority:!0}),(0,a.jsxs)("h1",{children:[t.data.name_category_circle," Community"]}),(0,a.jsxs)("div",{className:u().content_container,children:[(0,a.jsx)("div",{className:u().feed_container,children:(0,a.jsx)("form",{onSubmit:T,className:u().input_container,children:(0,a.jsxs)("div",{className:u().textarea_container,children:[(0,a.jsx)("div",{className:u().selected_image_container,children:w&&(null==w?void 0:w.map((e,t)=>(0,a.jsxs)("div",{className:u().image_render_container,children:[(0,a.jsx)(c(),{src:e.imageUrl,alt:e.filename,width:100,height:100,className:u().selected_image}),(0,a.jsx)("div",{className:u().remove_button,onClick:()=>H(t),children:(0,a.jsx)(c(),{src:x.Z,alt:"Icon",width:10,height:10,loader:m.t})})]},t)))}),(0,a.jsx)("textarea",{onClick:z,onChange:B,className:u().textarea_post,value:C,name:"content_post_circle",id:"",placeholder:"What do you want to share about?",maxLength:500}),(0,a.jsxs)("div",{className:u().footer_textarea,children:[(0,a.jsxs)("div",{className:u().left_section,children:[(0,a.jsx)("div",{className:u().input_image,onClick(){if(!i){r.push("/login");return}N.current.click()},children:(0,a.jsx)(c(),{src:g.Z,alt:"Icon",width:28,height:28})}),(0,a.jsx)("input",{ref:N,accept:"image/*",type:"file",id:"fileInput",name:"filename",onChange:D,className:u().input_file}),w&&(0,a.jsx)("span",{children:w.name})]}),(0,a.jsx)("div",{className:u().right_section,children:(0,a.jsx)("button",{className:u().btn_post,type:"submit",children:P?(0,a.jsx)(b.Z,{}):"Post"})})]})]})})}),E.length>0?E.map(e=>(0,a.jsx)(j.Z,{item:e},e.id_post_circle)):(0,a.jsx)("div",{className:u().no_post,children:"There is no post"}),L&&(0,a.jsx)("div",{className:u().btn_load_container,children:(0,a.jsx)("button",{className:u().btn_load_more,disabled:I,onClick:O,children:I?(0,a.jsx)("span",{children:"loading..."}):"Load More"})})]})]})};var y=!0;t.default=N},33828:function(e){e.exports={container:"feeds_container__B4BM2",banner_image:"feeds_banner_image__zwmtq",content_container:"feeds_content_container__K_hSM",feed_container:"feeds_feed_container__MfCLL",input_container:"feeds_input_container__e1E_H",textarea_container:"feeds_textarea_container__P2zox",selected_image_container:"feeds_selected_image_container__04gHH",selected_image:"feeds_selected_image__s1j6s",image_render_container:"feeds_image_render_container__JBGfy",remove_button:"feeds_remove_button__RqvQf",textarea_post:"feeds_textarea_post__Z
1pRRN",footer_textarea:"feeds_footer_textarea__r2_nX",left_section:"feeds_left_section__3krW9",input_image:"feeds_input_image__M81pi",input_file:"feeds_input_file__4Cerl",btn_post:"feeds_btn_post__f5D03",btn_load_container:"feeds_btn_load_container__Dhdg0",btn_load_more:"feeds_btn_load_more__EDBPG",no_post:"feeds_no_post__IpOtK",right_section:"feeds_right_section__xCwM9"}}},function(e){e.O(0,[4885,1818,5658,9774,2888,179],function(){return e(e.s=6161)}),_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.