PageSourceSearch

https://smartiz.ai/assets/NewsPage-Eqv1ciQo.js

js smartiz.ai collected 2026-10-05 12:38:55 UTC 3,230 bytes, 1 lines download raw bytes

1import{r as o,az as f,ay as h,a as e,ak as g}from"./index-BNIZXS9X.js";import{L as j}from"./react-router-dom-CNTZ-wWZ.js";import{N,F as w}from"./Navigation-DHdnVkh9.js";import{S as y}from"./SEOHead-DuWC-X_n.js";import{B as v}from"./badge-LO6eryVO.js";import{s as i,i as _,d as b,f as M}from"./safeDate-C57h0qxj.js";import{L}from"./loader-circle-CiCh4c_6.js";import{e as c}from"./format-DPouvYOD.js";import{C as P}from"./calendar-PEVyNbCY.js";import{M as k}from"./map-pin-BWqUTlLl.js";const S={en:c,fr:M,de:b,it:_},H=({initialArticles:n}={})=>{const d=Array.isArray(n)&&n.length>0,[r,m]=o.useState(n??[]),[x,p]=o.useState(!d),{t:a}=f(),{language:t}=h(),l=S[t]||c;return o.useEffect(()=>{let s=!1;return(async()=>{const{data:u}=await g.from("published_articles").select("id, title, slug, excerpt, cover_image_url, publication_date, news_subtype, event_date, event_location, reading_time_minutes").eq("type","news").eq("language",t).order("publication_date",{ascending:!1});s||(m(u||[]),p(!1))})(),()=>{s=!0}},[t]),e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsx(y,{title:a.newsPage.seoTitle,description:a.newsPage.seoDescription,canonicalUrl:`https://smartiz.ai${t==="en"?"":`/${t}`}/news`}),e.jsx(N,{}),e.jsx("main",{className:"container mx-auto px-4 pt-32 pb-16",children:e.jsxs("div",{className:"max-w-4xl mx-auto",children:[e.jsx("h1",{className:"text-4xl md:text-5xl font-bold mb-4",children:a.newsPage.title}),e.jsx("p",{className:"text-lg text-muted-foreground mb-12",children:a.newsPage.subtitle}),x?e.jsx("div",{className:"flex justify-center py-16",children:e.jsx(L,{className:"w-8 h-8 animate-spin"})}):r.length===0?e.jsx("p",{className:"text-center text-muted-foreground py-16",children:a.newsPage.noArticles}):e.jsx("div",{className:"space-y-8",children:r.map(s=>e.jsx(j,{to:`/news/${s.slug}`,className:"group block border rounded-xl overflow-hidden hover:shadow-lg transition-shadow",children:e.jsxs("article",{className:"md:flex",children:[s.cover_image_url&&e.jsx("div",{className:"md:w-80 md:flex-shrink-0",children:e.jsx("img",{src:s.cover_image_url,alt:s.title,className:"w-full h-48 md:h-full object-cover",loading:"lazy",decoding:"async",width:320,height:192})}),e.jsxs("div",{className:"p-6 flex flex-col justify-center",children:[e.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[s.news_subtype&&e.jsx(v,{variant:"secondary",children:s.news_subtype.replace("_"," ")}),e.jsx("time",{className:"text-sm text-muted-foreground",dateTime:s.publication_date,children:i(s.publication_date,"d MMMM yyyy",{locale:l})})]}),e.jsx("h2",{className:"text-xl font-semibold group-hover:text-primary transition-colors mb-2",children:s.title}),s.excerpt&&e.jsx("p",{className:"text-muted-foreground line-clamp-2",children:s.excerpt}),s.news_subtype==="event"&&s.event_date&&e.jsxs("div",{className:"flex items-center gap-4 mt-3 text-sm text-muted-foreground",children:[e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(P,{className:"w-4 h-4"}),i(s.event_date,"d MMMM yyyy",{locale:l})]}),s.event_location&&e.jsxs("span",{className:"flex items-center gap-1",children:[e.jsx(k,{className:"w-4 h-4"}),s.event_location]})]})]})]})},s.id))})]})}),e.jsx(w,{})]})};export{H as N};

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.