import{r as t,j as e}from"./vendor-react-Ci7aBfa0.js";import{b as N,S as v}from"./SEO-DMWyZzYz.js";import{A as w}from"./index-Bc-jHh02.js";import{s as y}from"./prerender-CvGl2zE9.js";import{d as A,L as r}from"./vendor-Clsy4qE9.js";import{ac as D,X as P,ad as p,h as F,a1 as S,b as C,d as k}from"./vendor-icons-4GGNjGXS.js";import"./vendor-helmet-X7vXU3pT.js";import"./vendor-ui-X4tvFhT0.js";function $(){const[i,o]=A(),[c,d]=t.useState([]),[m,x]=t.useState(1),[h,f]=t.useState(1),[n,g]=t.useState(!0),l=i.get("tag")||"";t.useEffect(()=>{window.scrollTo(0,0),x(1),b()},[l]),t.useEffect(()=>{n||y()},[n]);async function b(){try{g(!0);const s=await w(m,12,l);d(s.posts),f(s.pages)}catch{d([])}finally{g(!1)}}const j=N([{name:"Accueil",url:"/"},{name:"Blog",url:"/blog"}]);return e.jsxs("main",{className:"min-h-screen pt-20 md:pt-24 pb-16 bg-[#F8F9FA]",children:[e.jsx(v,{title:"Blog Traceur GPS — Conseils & Guides | AbidjanGPS",description:"Tous nos conseils, guides et actualités sur la géolocalisation, la sécurité automobile et la gestion de flotte en Côte d'Ivoire.",url:"/blog",jsonLd:j}),e.jsx("div",{className:"bg-[#333333] text-white py-12 md:py-16 mb-12",children:e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[e.jsxs("nav",{className:"text-sm text-gray-400 mb-4",children:[e.jsx(r,{to:"/",className:"hover:text-[#D45A00] transition-colors",children:"Accueil"}),e.jsx("span",{className:"mx-2",children:"/"}),e.jsx("span",{className:"text-white font-medium",children:"Blog"})]}),e.jsxs("div",{className:"max-w-3xl",children:[e.jsx("h1",{className:"text-3xl md:text-5xl font-extrabold mb-4",children:"Blog AbidjanGPS"}),e.jsx("p",{className:"text-lg text-gray-300 leading-relaxed",children:"Conseils pratiques, guides d'achat et actualités pour sécuriser vos véhicules et optimiser votre flotte en Côte d'Ivoire."}),l&&e.jsxs("div",{className:"inline-flex items-center gap-2 mt-4 px-4 py-2 bg-[#FFF5ED] text-[#D45A00] rounded-full text-sm font-medium",children:[e.jsx(D,{className:"w-4 h-4"}),"Articles tagués « ",l," »",e.jsx("button",{onClick:()=>{i.delete("tag"),o(i)},className:"ml-1 p-0.5 hover:bg-[#D45A00] hover:text-white rounded-full transition-colors","aria-label":"Retirer le filtre",children:e.jsx(P,{className:"w-3.5 h-3.5"})})]})]})]})}),e.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8",children:[n?e.jsx("div",{className:"flex justify-center py-20",children:e.jsx("div",{className:"w-8 h-8 border-4 border-[#D45A00] border-t-transparent rounded-full animate-spin"})}):c.length===0?e.jsxs("div",{className:"text-center py-20 bg-white rounded-2xl shadow-sm",children:[e.jsx(p,{className:"w-16 h-16 text-gray-300 mx-auto mb-4"}),e.jsx("h2",{className:"text-xl font-bold text-[#333333] mb-2",children:"Aucun article publié pour le moment"}),e.jsx("p",{className:"text-gray-500",children:"Revenez bientôt pour découvrir nos conseils."})]}):e.jsxs(e.Fragment,{children:[e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:c.map(s=>e.jsxs("article",{className:"group bg-white rounded-2xl overflow-hidden shadow-sm hover:shadow-xl transition-all duration-300 flex flex-col border border-gray-100",children:[e.jsxs(r,{to:`/blog/${s.slug}`,className:"block relative aspect-[16/10] bg-[#F2F2F2] overflow-hidden",children:[s.coverImage?e.jsx("img",{src:s.coverImage,alt:s.title,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500",loading:"lazy"}):e.jsx("div",{className:"w-full h-full flex items-center justify-center text-gray-400",children:e.jsx(p,{className:"w-12 h-12"})}),e.jsx("div",{className:"absolute top-4 left-4",children:e.jsxs("span",{className:"inline-flex items-center gap-1.5 px-3 py-1 bg-[#D45A00] text-white text-xs font-bold rounded-full shadow-sm",children:[e.jsx(F,{className:"w-3 h-3"}),Math.max(1,Math.ceil((s.excerpt?.length||0)/400))," min"]})})]}),e.jsxs("div",{className:"p-6 flex-1 flex flex-col",children:[e.jsx("div",{className:"flex items-center gap-3 text-xs text-gray-500 mb-3",children:e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(S,{className:"w-3.5 h-3.5"}),new Date(s.publishedAt).toLocaleDateString("fr-FR",{day:"numeric",month:"long",year:"numeric"})]})}),e.jsx(r,{to:`/blog/${s.slug}`,children:e.jsx("h2",{className:"text-xl font-bold text-[#333333] mb-3 group-hover:text-[#D45A00] transition-colors line-clamp-2 leading-tight",children:s.title})}),Array.isArray(s.tags)&&s.tags.length>0&&e.jsx("div",{className:"flex flex-wrap items-center gap-1.5 mb-3",children:s.tags.slice(0,3).map(a=>e.jsx("button",{onClick:u=>{u.preventDefault(),u.stopPropagation(),o({tag:a})},className:"text-[10px] px-2 py-0.5 bg-[#FFF5ED] text-[#D45A00] rounded-full font-medium hover:bg-[#D45A00] hover:text-white transition-colors",children:a},a))}),e.jsx("p",{className:"text-gray-600 line-clamp-3 mb-5 flex-1 leading-relaxed",children:s.excerpt}),e.jsxs(r,{to:`/blog/${s.slug}`,className:"inline-flex items-center text-sm font-semibold text-[#D45A00] hover:underline mt-auto",children:["Lire l'article ",e.jsx(C,{className:"w-4 h-4"})]})]})]},s.id))}),h>1&&e.jsx("div",{className:"flex justify-center gap-2 mt-12",children:Array.from({length:h},(s,a)=>a+1).map(s=>e.jsx("button",{onClick:()=>x(s),className:`w-10 h-10 rounded-lg font-medium transition-colors ${m===s?"bg-[#D45A00] text-white shadow-md":"bg-white text-gray-600 hover:bg-[#D45A00]/10 border border-gray-200"}`,children:s},s))})]}),e.jsx("div",{className:"mt-16 bg-white rounded-2xl shadow-sm p-8 md:p-10 border border-gray-100",children:e.jsxs("div",{className:"flex flex-col md:flex-row md:items-center md:justify-between gap-6",children:[e.jsxs("div",{children:[e.jsx("h2",{className:"text-2xl font-bold text-[#333333] mb-2",children:"Vous ne trouvez pas la réponse à votre question ?"}),e.jsx("p",{className:"text-gray-600",children:"Nos experts vous répondent directement sur WhatsApp."})]}),e.jsxs("a",{href:"https://wa.me/2250170090932?text=Bonjour%20AbidjanGPS%2C%20j'ai%20une%20question",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center justify-center px-6 py-3 bg-[#25D366] text-white rounded-lg font-semibold hover:bg-[#1fa855] transition-colors shrink-0",children:[e.jsx(k,{className:"w-5 h-5 mr-2"}),"Poser ma question"]})]})})]})]})}export{$ as default};