PageSourceSearch

https://babamarket.co.id/js/BlogFilterPage-JNm2V-Bz.js

js babamarket.co.id collected 2026-10-06 12:53:53 UTC 4,076 bytes, 2 lines download raw bytes

1import{j as t}from"./mui-BAY0EgUh.js";import{j as M,k as U,L as I,a as s}from"./react-C-pmN5Hv.js";import{F as K,A as L}from"./FeaturedArticle-6PP89BI1.js";import{S as $,B as h}from"./index-B399VXLj.js";import{P as _}from"./PageWrapper-BFtStl4k.js";import"./index-BUVwXYIo.js";import"./vendor-DtY_l6si.js";import"./createLucideIcon-DG8lbe9X.js";const D=()=>{const[i]=M(),c=U(),a=c.name||i.get("tags"),o=c.slug||i.get("category"),[n,l]=s.useState(null),[j,f]=s.useState(!0),[B,d]=s.useState(null),[S,k]=s.useState([]),[m,b]=s.useState(""),[x,p]=s.useState(null),[g,C]=s.useState([]),[P,v]=s.useState(null);s.useEffect(()=>{(async()=>{try{const e=await h.getBlogCommon();e.status===200&&v(e.data.data||{})}catch(e){d(e.message)}})(),E(),T()},[]);const E=async()=>{try{const r=await h.getBlogCategories();r.status===200&&k(r.data.data||[])}catch{}},T=async()=>{try{const r=await h.getBlogTags();r.status===200&&C(r.data.data||[])}catch{}},[y,N]=s.useState(1),[w,R]=s.useState(!1);s.useEffect(()=>{N(1)},[o,a,m]),s.useEffect(()=>{(async()=>{f(!0),d(null);try{const e={page:y};o&&(e.category=decodeURIComponent(o)),a&&(e.tags=decodeURIComponent(a)),m&&(e.keyword=m);const u=await h.getBlog(e);u.status===200?l(u.data):l(null)}catch(e){d(e.message)}finally{f(!1)}})()},[o,a,y,m]);const A=async()=>{if(w||!n?.meta)return;const r=y+1;if(!(r>n.meta.total_pages)){R(!0);try{const e={page:r};o&&(e.category=decodeURIComponent(o)),a&&(e.tags=decodeURIComponent(a)),m&&(e.keyword=m);const u=await h.getBlog(e);u.status===200&&(l(F=>({...u.data,data:[...F?.data||[],...u.data.data]})),N(r))}catch(e){d(e.message)}finally{R(!1)}}},z=n?.meta?y<n.meta.total_pages:!1;return{blogs:n,loading:j,error:B,categories:S,selectedCategory:x,setSelectedCategory:p,setTags:C,common:P,tags:g,setCurrentPage:N,setKeyword:b,loadMore:A,hasMore:z,loadingMore:w,currentPage:y}};function q(){const{blogs:i,loading:c,error:a,categories:o,setSelectedCategory:n,tags:l,setTags:j,common:f,setKeyword:B,loadMore:d,hasMore:S,loadingMore:k,currentPage:m}=D(),[b]=M(),x=U(),p=x.name||b.get("tags"),g=x.slug||b.get("category"),C=g?o?.find(P=>P.slug===g)?.name||decodeURIComponent(g):null;return t.jsx("div",{className:"container mx-auto",children:t.jsxs("div",{className:"container my-5",children:[t.jsx("nav",{"aria-label":"breadcrumb",className:"mb-4",children:t.jsxs("ol",{className:"breadcrumb",children:[t.jsx("li",{className:"breadcrumb-item",children:t.jsx(I,{to:"/",className:"text-decoration-none text-muted",style:{fontSize:"0.875rem"},children:"Home"})}),t.jsx("li",{className:"breadcrumb-item",children:t.jsx(I,{to:"/blog",className:"text-decoration-none text-muted",style:{fontSize:"0.875rem"},children:"Blog"})}),p&&t.jsxs("li",{className:"breadcrumb-item active","aria-current":"page",style:{fontSize:"0.875rem"},children:["Tag: ",decodeURIComponent(p)]}),g&&t.jsxs("li",{className:"breadcrumb-item active","aria-current":"page",style:{fontSize:"0.875rem"},children:["Kategori: ",C]})]})}),t.jsxs("div",{className:"row",children:[t.jsxs("div",{className:"col-md-9",children:[!p&&!g&&t.jsx(K,{data:f?.favorite_post}),a?t.jsx("div",{className:"alert alert-danger",role:"alert",children:a}):t.jsx(L,{articles:i?.data||[],meta:i?.meta,loading:c,loadingMore:k,setKeyword:B,loadMore:d,hasMore:S,currentPage:m})]}),t.jsx($,{categories:o||[],setCategories:n,tags:l,setTags:j,common:f})]})]})})}function Y(){const[i]=M(),c=i.get("tags"),a=i.get("category");return s.useEffect(()=>{let o="Blog | Baba Market",n="Baca artikel dan tips terbaru seputar bahan bangunan dan konstruksi di blog Baba Market.";c?(o=`Artikel dengan Tag: ${decodeURIComponent(c)} | Baba Market`,n=`Temukan artikel terbaru dengan tag ${decodeURIComponent(c)} di blog Baba Market.`):a&&(o=`Kategori: ${decodeURIComponent(a)} | Baba Market`,n=`Jelajahi artikel dalam kategori ${decodeURIComponent(a)} di blog Baba Market.`),document.title=o;const l=document.querySelector('meta[name="description"]');l&&l.setAttribute("content",n)},[c,a]),t.jsx(_,{children:t.jsx(q,{})})}export{Y as default};
2//# sourceMappingURL=BlogFilterPage-JNm2V-Bz.js.map

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.