1import{j as e}from"./markdown-Bv2Zz7uJ.js";import{r}from"./vendor-CaCYlTQf.js";import{L as f}from"./router-pLLGwmo9.js";import{W as L}from"./helmet-tNkLyeaY.js";import{g as B,a as k,b as D}from"./blogPosts-08d3xH5i.js";import{B as E}from"./BackToTop-DekbRhmr.js";import{u as P}from"./i18n-DCUII1Au.js";import{c as $,d as A,e as F,T as R}from"./icons-fd5MUC8v.js";const I=()=>{const{t:s,i18n:l}=P(),[o,g]=r.useState(""),[n,m]=r.useState("all"),[c,x]=r.useState("all"),[p,N]=r.useState([]),[y,v]=r.useState([]),[w,T]=r.useState([]),[C,u]=r.useState(!0),h=a=>l.language==="en"?a==="/"?"/en/":`/en${a}`:a;r.useEffect(()=>{(async()=>{u(!0);try{const[t,i,d]=await Promise.all([B(l.language),k(l.language),D(l.language)]);N(t),v(i),T(d)}catch(t){console.error("Error loading blog data:",t)}finally{u(!1)}})()},[l.language]);const b=p.filter(a=>{const t=a.title.toLowerCase().includes(o.toLowerCase())||a.excerpt.toLowerCase().includes(o.toLowerCase()),i=n==="all"||a.category===n,d=c==="all"||a.tags.includes(c);return t&&i&&d}),S=a=>{const t=l.language==="en"?"en-US":"fr-FR";return new Date(a).toLocaleDateString(t,{year:"numeric",month:"long",day:"numeric"})},j=a=>({tech:s("blog.categories.tech","Technique"),opinion:s("blog.categories.opinion","Opinion"),blog:s("blog.categories.blog","Blog")})[a]||a;return C?e.jsx("div",{className:"section-padding",children:e.jsx("div",{className:"container-custom",children:e.jsxs("div",{className:"text-center py-12",children:[e.jsx("div",{className:"animate-spin rounded-full h-12 w-12 border-b-2 border-terracloud-orange mx-auto"}),e.jsx("p",{className:"mt-4 text-terracloud-gray",children:s("common.loading","Loading...")})]})})}):e.jsxs(e.Fragment,{children:[e.jsxs(L,{children:[e.jsx("title",{children:s("blog.title")}),e.jsx("meta",{name:"description",content:s("blog.description")})]}),e.jsx("div",{className:"section-padding",children:e.jsxs("div",{className:"container-custom",children:[e.jsxs("div",{className:"text-center mb-12",children:[e.jsx("h1",{className:"text-4xl lg:text-5xl font-bold text-terracloud-dark mb-4",children:s("blog.hero.title")}),e.jsx("p",{className:"text-xl text-terracloud-gray max-w-3xl mx-auto",children:s("blog.hero.description")})]}),e.jsx("div",{className:"bg-white rounded-lg shadow-sm p-6 mb-8",children:e.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4",children:[e.jsxs("div",{className:"relative",children:[e.jsx($,{className:"absolute left-3 top-1/2 transform -translate-y-1/2 text-gray-400 h-5 w-5"}),e.jsx("input",{type:"text",placeholder:s("blog.search.placeholder"),value:o,onChange:a=>g(a.target.value),className:"w-full pl-10 pr-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-terracloud-orange focus:border-transparent"})]}),e.jsxs("select",{value:n,onChange:a=>m(a.target.value),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-terracloud-orange focus:border-transparent",children:[e.jsx("option",{value:"all",children:s("blog.filters.allCategories")}),y.map(a=>e.jsx("option",{value:a,children:j(a)},a))]}),e.jsxs("select",{value:c,onChange:a=>x(a.target.value),className:"w-full px-4 py-2 border border-gray-300 rounded-lg focus:ring-2 focus:ring-terracloud-orange focus:border-transparent",children:[e.jsx("option",{value:"all",children:s("blog.filters.allTags")}),w.map(a=>e.jsx("option",{value:a,children:a},a))]})]})}),e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-8",children:b.map(a=>e.jsxs("article",{className:"bg-white rounded-lg shadow-sm hover:shadow-md transition-shadow overflow-hidden",children:[a.image&&e.jsx("div",{className:"aspect-video bg-gray-50 flex items-center justify-center",children:e.jsx("img",{src:a.image,alt:a.title,className:"max-w-full max-h-full object-contain p-4",onError:t=>{t.currentTarget.style.display="none"}})}),e.jsxs("div",{className:"p-6",children:[e.jsx("div",{className:"mb-3",children:e.jsx("span",{className:`inline-block px-3 py-1 text-xs font-medium rounded-full ${a.category==="tech"?"bg-blue-100 text-blue-800":a.category==="opinion"?"bg-green-100 text-green-800":"bg-gray-100 text-gray-800"}`,children:j(a.category)})}),e.jsx("h2",{className:"text-xl font-semibold text-terracloud-dark mb-3 line-clamp-2",children:e.jsx(f,{to:h(`/blog/${a.slug}`),className:"hover:text-terracloud-orange transition-colors",children:a.title})}),e.jsx("p",{className:"text-terracloud-gray mb-4 line-clamp-3",children:a.excerpt}),e.jsxs("div",{className:"flex items-center justify-between text-sm text-gray-500 mb-4",children:[e.jsxs("div",{className:"flex items-center",children:[e.jsx(A,{className:"h-4 w-4 mr-1"}),S(a.publishedAt)]}),e.jsxs("div",{className:"flex items-center",children:[e.jsx(F,{className:"h-4 w-4 mr-1"}),a.readingTime," ",s("blog.readingTime")]})]}),e.jsxs("div",{className:"flex flex-wrap gap-2 mb-4",children:[a.tags.slice(0,3).map(t=>e.jsxs("span",{className:"inline-flex items-center px-2 py-1 text-xs bg-gray-100 text-gray-600 rounded",children:[e.jsx(R,{className:"h-3 w-3 mr-1"}),t]},t)),a.tags.length>3&&e.jsxs("span",{className:"text-xs text-gray-500",children:["+",a.tags.length-3," ",s("blog.moreTags")]})]}),e.jsxs(f,{to:h(`/blog/${a.slug}`),className:"text-terracloud-orange hover:text-terracloud-blue transition-colors font-medium",children:[s("blog.readMore")," â"]})]})]},a.id))}),b.length===0&&e.jsxs("div",{className:"text-center py-12",children:[e.jsx("p",{className:"text-xl text-terracloud-gray",children:s("blog.noResults")}),e.jsx("button",{onClick:()=>{g(""),m("all"),x("all")},className:"mt-4 text-terracloud-orange hover:text-terracloud-blue transition-colors",children:s("blog.resetFilters")})]})]})}),e.jsx(E,{})]})};export{I 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.