PageSourceSearch

https://www.ctmvet.com/assets/BlogPage-C9iUkby2.js

js ctmvet.com collected 2026-10-09 23:21:07 UTC 4,360 bytes, 1 lines download raw bytes

1import{j as e,r as t}from"./react-vendor-DAMD_DlO.js";import{X as L,Y as y,Z as a,$ as M,a0 as k,a1 as E,a2 as T,S as z,s as P,P as Y,b as $,B as m}from"./index-D9e3d9VB.js";import{L as b,d as q}from"./router-BQ9uWP9Y.js";import{B as F}from"./BlogSearch-B1XKvXIg.js";function R({post:l}){const h=L(l.publishedAt),u=`${y.articoli}/${l.slug}`;return e.jsxs("article",{className:"blog-card",children:[e.jsxs("div",{className:"blog-card-meta",children:[e.jsx("span",{className:"blog-card-badge",children:a.categoryLabel}),h?e.jsx("time",{className:"blog-card-date",dateTime:l.publishedAt,children:h}):null]}),e.jsx("p",{className:"library-card-source",children:a.sourceLabel}),e.jsx("h2",{className:"blog-card-title",children:e.jsx(b,{to:u,children:l.title})}),e.jsx("p",{className:"blog-card-excerpt",children:l.excerpt}),l.keywords?.length?e.jsx("p",{className:"library-card-topics",children:l.keywords.slice(0,3).join(" · ")}):null,e.jsx(b,{className:"blog-card-link",to:u,children:"Leggi l’articolo"})]})}const p=20;function D(){const l=t.useMemo(()=>M(),[]),h=t.useMemo(()=>k(),[]),u=t.useMemo(()=>E(),[]),[g,f]=q(),[r,S]=t.useState(()=>g.get("q")||""),[i,B]=t.useState(()=>{const s=g.get("anno");return s?Number(s):null}),[n,w]=t.useState(()=>g.get("argomento")||""),[o,A]=t.useState(()=>g.get("ordina")||"newest"),[C,x]=t.useState(1),c=t.useMemo(()=>T({query:r,year:i,topic:n,sort:o}),[r,i,n,o]);t.useEffect(()=>{const s=new URLSearchParams;r.trim()&&s.set("q",r.trim()),i&&s.set("anno",String(i)),n&&s.set("argomento",n),o!=="newest"&&s.set("ordina",o),f(s,{replace:!0})},[r,i,n,o,f]),t.useEffect(()=>{x(1)},[r,i,n,o]);const j=Math.max(1,Math.ceil(c.length/p)),d=Math.min(C,j),v=c.slice((d-1)*p,d*p),N=r.trim().length>0;return e.jsxs(e.Fragment,{children:[e.jsx(z,{title:P.blog.title,description:P.blog.description}),e.jsx(Y,{eyebrow:a.eyebrow,title:a.title,description:a.intro,paper:!0}),e.jsxs($,{className:"section-chat-pad",children:[e.jsx("p",{className:"library-archive-nav",children:e.jsx(b,{to:y.hub,children:"← Tutti gli Approfondimenti"})}),e.jsx(F,{id:"blog-search",value:r,onChange:S,resultsCount:c.length,totalCount:l.length,title:a.searchTitle,placeholder:a.searchPlaceholder}),e.jsxs("div",{className:"approfondimenti-filters",role:"group","aria-label":"Filtri articoli",children:[e.jsxs("label",{className:"approfondimenti-filter",children:[e.jsx("span",{children:"Argomento"}),e.jsxs("select",{value:n,onChange:s=>w(s.target.value),children:[e.jsx("option",{value:"",children:a.filterAllTopics}),u.map(s=>e.jsxs("option",{value:s.slug,children:[s.label," (",s.count,")"]},s.slug))]})]}),e.jsxs("label",{className:"approfondimenti-filter",children:[e.jsx("span",{children:"Anno"}),e.jsxs("select",{value:i??"",onChange:s=>B(s.target.value?Number(s.target.value):null),children:[e.jsx("option",{value:"",children:a.filterAllYears}),h.map(s=>e.jsx("option",{value:s,children:s},s))]})]}),e.jsxs("label",{className:"approfondimenti-filter",children:[e.jsx("span",{children:"Ordine"}),e.jsxs("select",{value:o,onChange:s=>A(s.target.value),children:[e.jsx("option",{value:"newest",children:a.sortNewest}),e.jsx("option",{value:"oldest",children:a.sortOldest})]})]})]}),v.length>0?e.jsx("div",{className:"blog-grid",children:v.map(s=>e.jsx(R,{post:s},s.id))}):e.jsxs("p",{className:"blog-empty",children:["Nessun articolo corrisponde",N?e.jsxs(e.Fragment,{children:[" a “",r.trim(),"”"]}):null,". Prova con un altro termine, ad esempio ",e.jsx("em",{children:"leishmaniosi"}),", ",e.jsx("em",{children:"esami"})," o ",e.jsx("em",{children:"terapia"}),"."]}),c.length>p&&e.jsxs("nav",{className:"blog-pagination","aria-label":"Paginazione articoli",children:[e.jsx(m,{as:"button",type:"button",variant:"outline",disabled:d===1,onClick:()=>x(s=>s-1),children:"Articoli precedenti"}),e.jsxs("span",{className:"blog-pagination-status",children:["Pagina ",d," di ",j,N?` · ${c.length} risultati`:""]}),e.jsx(m,{as:"button",type:"button",variant:"outline",disabled:d===j,onClick:()=>x(s=>s+1),children:"Articoli successivi"})]}),e.jsx("p",{className:"group-source-note",children:a.sourceLabel}),e.jsxs("p",{className:"sec-cta-row",children:[e.jsx(m,{href:"/come-funziona",children:"Scopri come funziona la consulenza"}),e.jsx(m,{href:"/contatti",variant:"outline",children:"Richiedi di essere ricontattato"})]})]})]})}export{D as BlogPage};

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.