1import{j as e,L as p,q as h,T as C,i as T,k as A,l as P,I as o,r as j}from"./index-B0oEyro8.js";import{B as F}from"./BreadcrumbComp-CfQazsh3.js";import{l as m}from"./lodash-CdJ6eZdv.js";import{G as g}from"./index-DsGUEUk9.js";import{C as f}from"./card-D1aDpVTe.js";import{A as v,a as u,b as N}from"./avatar-CwbH2X92.js";import{f as w}from"./format-C6thGpSm.js";import{B as b,a as E}from"./index-ClJOAPaY.js";import"./iconBase-CWUu3QQx.js";import"./index-Cqp21In5.js";import"./en-US-CxAH6SjG.js";import"./toDate-qY-Vit60.js";import"./globalFetcher-CGhUFlJK.js";const L=({post:a})=>{const{coverImg:d,title:n,view:i,comments:r,category:c,author:s,createdAt:t}=a,l=n.toLowerCase().replace(/ /g,"-").replace(/[^\w-]+/g,"");return e.jsx(e.Fragment,{children:e.jsx("div",{className:"lg:col-span-4 md:col-span-6 col-span-12",children:e.jsxs(f,{className:"p-0 overflow-hidden group card-hover",children:[e.jsxs("div",{className:"relative",children:[e.jsxs(p,{to:`/apps/blog/detail/${l}`,children:[e.jsx("div",{className:"overflow-hidden h-[240px]",children:e.jsx("img",{src:d,alt:"tailwindadmin",height:240,width:500,className:"w-full"})}),e.jsx(h,{variant:"white",className:"absolute bottom-8 end-6",children:"2 min Read"})]}),e.jsx("div",{className:"flex justify-between items-center -mt-6 px-6",children:e.jsx("div",{children:e.jsx(C,{children:e.jsxs(T,{children:[e.jsx(A,{children:e.jsxs(v,{children:[e.jsx(u,{src:s==null?void 0:s.avatar,alt:s==null?void 0:s.name}),e.jsx(N,{children:s==null?void 0:s.name})]})}),e.jsx(P,{children:s==null?void 0:s.name})]})})})})]}),e.jsxs("div",{className:"px-6 pb-6",children:[e.jsx(h,{variant:"muted",className:"mt-3",children:c}),e.jsx("h5",{className:"text-xl py-6 group-hover:text-primary",children:e.jsxs(p,{to:`/apps/blog/detail/${l}`,className:"line-clamp-2",children:[" ",n]})}),e.jsx("div",{children:e.jsxs("div",{className:"flex gap-3",children:[e.jsxs("div",{className:"flex gap-2 items-center text-darklink text-[15px]",children:[e.jsx(o,{icon:"tabler:eye",height:"18",className:"text-ld"})," ",i]}),e.jsxs("div",{className:"flex gap-2 items-center text-darklink text-[15px]",children:[e.jsx(o,{icon:"tabler:message-2",height:"18",className:"text-ld"})," ",r==null?void 0:r.length]}),e.jsxs("div",{className:"ms-auto flex gap-2 items-center text-darklink text-[15px]",children:[e.jsx(g,{size:"16",className:"text-ld"}),e.jsx("small",{children:w(new Date(t),"E, MMM d")})]})]})})]})]})})})},M=({post:a,index:d})=>{const{coverImg:n,title:i,view:r,comments:c,category:s,author:t,createdAt:l}=a,x=i.toLowerCase().replace(/ /g,"-").replace(/[^\w-]+/g,""),B=d===0,{setLoading:y}=j.useContext(b);return j.useEffect(()=>{const k=setTimeout(()=>{y(!1)},700);return()=>clearTimeout(k)},[]),e.jsx(e.Fragment,{children:a?e.jsx("div",{className:`lg:col-span-${B?8:4} md:col-span-12 col-span-12`,children:e.jsxs(f,{className:"w-full h-[400px] p-0 overflow-hidden flex-row shadow-none feature-card relative card-hover",children:[e.jsxs("div",{className:"absolute inset-0",children:[e.jsx("img",{src:n,alt:i,className:"w-full h-full object-cover"}),e.jsx("div",{className:"absolute inset-0 bg-black opacity-50 mix-blend-multiply"})]}),e.jsx("div",{className:"absolute w-full h-full left-0 p-6",children:e.jsxs("div",{className:"flex flex-col h-full justify-between ",children:[e.jsxs("div",{className:"flex justify-between items-center",children:[e.jsxs(v,{className:"h-10 w-10",children:[e.jsx(u,{src:t==null?void 0:t.avatar,alt:t==null?void 0:t.name}),e.jsx(N,{children:t!=null&&t.name?t.name[0]:"?"})]}),e.jsx(h,{children:s})]}),e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl text-white my-6",children:e.jsxs(p,{to:`/apps/blog/detail/${x}`,children:[" ",i]})}),e.jsxs("div",{className:"flex gap-3",children:[e.jsxs("div",{className:"flex gap-2 items-center text-white text-[15px]",children:[e.jsx(o,{icon:"tabler:eye",height:"18"})," ",r]}),e.jsxs("div",{className:"flex gap-2 items-center text-white text-[15px]",children:[e.jsx(o,{icon:"tabler:message-2",height:"18"})," ",c==null?void 0:c.length]}),e.jsxs("div",{className:"ms-auto flex gap-2 items-center text-white text-[15px]",children:[e.jsx(g,{size:"16"}),e.jsx("small",{children:w(new Date(l),"E, MMM d")})]})]})]})]})})]})}):null})},I=()=>{const{posts:a,sortBy:d}=j.useContext(b),n=(s,t)=>{let l=[...s];return t==="newest"?l=m.orderBy(l,["createdAt"],["desc"]):t==="oldest"?l=m.orderBy(l,["createdAt"],["asc"]):t==="popular"&&(l=m.orderBy(l,["view"],["desc"])),l.filter(x=>!x.featured)},i=s=>s.filter(t=>t.featured),r=n(a,d),c=i(a);return e.jsxs("div",{className:"grid grid-cols-12 gap-6",children:[c.map((s,t)=>e.jsx(M,{index:t,post:s},s.id)),r.map(s=>e.jsx(L,{post:s},s.id))]})},$=()=>e.jsx(e.Fragment,{children:e.jsx(E,{children:e.jsx(I,{})})}),D=[{to:"/",title:"Home"},{title:"Blog app"}],X=()=>e.jsxs(e.Fragment,{children:[e.jsx(F,{title:"Blog app",items:D}),e.jsx($,{})]});
1export{X as default};
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.