1(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[9195],{47737:function(e,t,a){(window.__NEXT_P=window.__NEXT_P||[]).push(["/blog",function(){return a(59454)}])},59454:function(e,t,a){"use strict";a.r(t),a.d(t,{__N_SSP:function(){return x},default:function(){return p}});var n=a(52676),r=a(75271),s=a(7638),i=a(89120),l=a.n(i),o=a(46035),d=a(46980),c=a(94170),u=a(33782),g=a(27026),f=a.n(g),h=a(22903),m=e=>{var t;let{blog:a}=e,r=(null===(t=a.featuredImage)||void 0===t?void 0:t.key)?(0,h.I)(a.featuredImage.key):null;return(0,n.jsxs)(f(),{href:"/blog/".concat(a.refId,"/").concat(a.slug),className:"flex overflow-hidden flex-col no-underline bg-white rounded-2xl shadow-sm group",children:[(0,n.jsx)("div",{className:"overflow-hidden relative w-full h-56 bg-gray-100",children:r?(0,n.jsx)("img",{src:r,alt:a.title,className:"block object-cover w-full h-full",loading:"lazy",decoding:"async"}):(0,n.jsx)("div",{className:"w-full h-full bg-gradient-to-br from-gray-100 to-gray-200"})}),(0,n.jsxs)("div",{className:"p-4",children:[(0,n.jsx)("h3",{className:"line-clamp-2 text-base font-semibold text-neutral-900 group-hover:text-[#FB233B]",children:a.title}),a.tags&&a.tags.length>0?(0,n.jsx)("div",{className:"flex flex-wrap gap-1.5 mt-3",children:a.tags.slice(0,3).map(e=>(0,n.jsx)("span",{className:"inline-flex items-center rounded-full bg-neutral-100 px-2.5 py-0.5 text-xs font-medium text-neutral-600",children:e},e))}):null]})]})},x=!0,p=e=>{var t;let{user:a}=e,[i,g]=(0,r.useState)(""),[f,h]=(0,r.useState)(""),x=(0,r.useMemo)(()=>l()(e=>{h(e)},300),[]),p=(0,r.useCallback)(e=>{g(e),x(e)},[x]),b=(0,s.N)({queryKey:["blog","public",f],initialPageParam:1,queryFn:async e=>{let{pageParam:t}=e;return await (0,u.sd)({page:t,pageSize:10,sortField:"publishedAt",sortOrder:c.As.DESC,search:f})},getNextPageParam:(e,t)=>{let a=e.data.total;return t.reduce((e,t)=>e+t.data.rows.length,0)<a?t.length+1:void 0}}),v=(0,r.useMemo)(()=>{var e,t;return null!==(t=null===(e=b.data)||void 0===e?void 0:e.pages.flatMap(e=>e.data.rows))&&void 0!==t?t:[]},[null===(t=b.data)||void 0===t?void 0:t.pages]);return(0,n.jsxs)(d.Z,{user:a,children:[(0,n.jsx)(o.PB,{title:"Blogs",description:"Tips, updates, and guides from Samu Giken.",canonical:"".concat("https://samugiken.com","/blog")}),(0,n.jsxs)("div",{className:"px-4 maxContainer md:px-6",children:[(0,n.jsxs)("div",{className:"flex flex-col gap-3 mt-4 md:flex-row md:justify-between",children:[(0,n.jsxs)("div",{children:[(0,n.jsx)("h1",{className:"text-2xl font-bold md:text-3xl text-neutral-900",children:"Blogs"}),(0,n.jsx)("p",{className:"mt-1 text-sm text-neutral-600",children:"Tips, updates, and guides from Samu Giken."})]}),(0,n.jsx)("div",{className:"w-full md:max-w-[420px] md:pr-8",children:(0,n.jsx)("input",{value:i,onChange:e=>p(e.target.value),placeholder:"Search by title, tag, or content...",className:"mt-7 w-full rounded-xl border border-neutral-200 bg-white px-4 py-3 text-sm outline-none transition focus:border-[#FB233B] focus:ring-2 focus:ring-[#FB233B]/20"})})]}),(0,n.jsx)("div",{className:"grid grid-cols-1 gap-5 mt-8 md:grid-cols-2 lg:grid-cols-3",children:v.map(e=>(0,n.jsx)(m,{blog:e},e.refId))}),b.isLoading?(0,n.jsx)("div",{className:"mt-8 text-sm text-neutral-600",children:"Loading..."}):null,b.isLoading||0!==v.length?null:(0,n.jsx)("div",{className:"p-6 mt-8 text-sm bg-white rounded-xl border border-neutral-200 text-neutral-700",children:"No blog posts found."}),(0,n.jsx)("div",{className:"flex justify-center mt-10",children:b.hasNextPage?(0,n.jsx)("button",{type:"button",onClick:()=>b.fetchNextPage(),disabled:b.isFetchingNextPage,className:"rounded-xl bg-[#FB233B] px-6 py-3 text-sm font-semibold text-white transition hover:opacity-95 disabled:cursor-not-allowed disabled:opacity-60",children:b.isFetchingNextPage?"Loading...":"Load more"}):null})]})]})}},33782:function(e,t,a){"use strict";a.d(t,{De:function(){return r},F8:function(){return u},Vh:function(){return i},X4:function(){return d},YO:function(){return o},sd:function(){return c},zZ:function(){return l},zv:function(){return s}});var n=a(5409);let r=e=>n.Z.get("/admin/blog",{params:e}),s=e=>n.Z.get("/admin/blog/".concat(e.id)),i=e=>n.Z.post("/admin/blog",e),l=e=>n.Z.put("/admin/blog/".concat(e.id),e),o=e=>n.Z.put("/admin/blog/".concat(e.id,"/status"),e),d=e=>n.Z.delete("/admin/blog/".concat(e.id)),c=e=>n.Z.get("/public/blog",{params:e}),u=async e=>{let t=new FormData;return t.append("file",e),n.J.post("/admin/blog/blog-featured-image",t)}},7638:function(e,t,a){"use strict";a.d(t,{N:function(){return l}});var n=a(66693),r=a(67565),s=class extends n.z{constructor(e,t){super(e,t)}bindMethods(){super.bindMethods(),this.fetchNextPage=this.fetchNextPage.bind(this),this.fetchPreviousPage=this.fetchPreviousPage.bind(this)}setOptions(e){e._type="infinite",super.setOptions(e)}getOptimisticResult(e){return e._type="infinite",super.getOptimisticResult(e)}
1fetchNextPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"forward"}}})}fetchPreviousPage(e){return this.fetch({...e,meta:{fetchMore:{direction:"backward"}}})}createResult(e,t){let{state:a}=e,n=super.createResult(e,t),{isFetching:s,isRefetching:i,isError:l,isRefetchError:o}=n,d=a.fetchMeta?.fetchMore?.direction,c=l&&"forward"===d,u=s&&"forward"===d,g=l&&"backward"===d,f=s&&"backward"===d;return{...n,fetchNextPage:this.fetchNextPage,fetchPreviousPage:this.fetchPreviousPage,hasNextPage:(0,r.Qy)(t,a.data),hasPreviousPage:(0,r.ZF)(t,a.data),isFetchNextPageError:c,isFetchingNextPage:u,isFetchPreviousPageError:g,isFetchingPreviousPage:f,isRefetchError:o&&!c&&!g,isRefetching:i&&!u&&!f}}},i=a(12882);function l(e,t){return(0,i.r)(e,s,t)}}},function(e){e.O(0,[5989,4237,7610,8174,9834,9830,6980,2888,9774,179],function(){return e(e.s=47737)}),_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.