1import{r as j,j as e}from"./vendor-react-pTgRmW_L.js";import{a0 as $,u as k,a as z,d as C,L as a,A as L}from"./index-fZroaDUW.js";import{k as l,N,B as S,aa as b}from"./vendor-lucide-C9Vpy6qL.js";const R=({slug:s})=>{const[i,g]=j.useState(null),f=j.useCallback(h=>$(s,h).then(r=>(h===1&&g(r.sector),{items:r.articles,lastPage:r.pagination.last_page,total:r.pagination.total})),[s]),{items:x,total:n,loading:y,loadingMore:m,error:w,hasMore:d,sentinelRef:u,loadMore:v}=k(f,[s]),c=window.location.origin,t=(i==null?void 0:i.name)??"",p=`Latest ${t} news â ${n} articles about companies in the ${t} sector on The Robotics Media.`,o=`${c}/companies/${s}/news`;return z(i?{title:`${t} News`,description:p.slice(0,160),ogType:"website",canonical:o,jsonLd:[{"@context":"https://schema.org","@type":"CollectionPage",name:`${t} News`,description:p.slice(0,300),url:o},C([{name:"Home",url:`${c}/`},{name:"Companies",url:`${c}/companies`},{name:t,url:`${c}/companies/${s}`},{name:"News",url:o}])]}:{title:"Sector News"}),e.jsxs("div",{className:"bg-gray-50 min-h-screen",children:[e.jsx("div",{className:"bg-white border-b border-gray-100",children:e.jsxs("div",{className:"max-w-[1280px] mx-auto px-6 pt-6 pb-7",children:[e.jsxs("nav",{className:"flex items-center flex-wrap gap-1.5 text-xs text-gray-400 mb-5",children:[e.jsx(a,{to:"/",className:"hover:text-[#007ab7]",children:"Home"}),e.jsx(l,{size:12}),e.jsx(a,{to:"/companies",className:"hover:text-[#007ab7]",children:"Companies"}),e.jsx(l,{size:12}),e.jsx(a,{to:`/companies/${s}`,className:"hover:text-[#007ab7]",children:t||s}),e.jsx(l,{size:12}),e.jsx("span",{className:"text-gray-600 font-semibold",children:"News"})]}),e.jsxs("span",{className:"inline-flex items-center gap-2 text-[11px] font-extrabold uppercase tracking-[0.25em] text-[#007ab7] mb-2",children:[e.jsx(N,{size:14})," Sector news"]}),e.jsxs("h1",{className:"text-3xl lg:text-5xl font-extrabold tracking-tight text-gray-900",children:[t," News"]}),e.jsxs("div",{className:"flex items-center gap-4 mt-2",children:[n>0&&e.jsxs("p",{className:"text-gray-500",children:[n," article",n!==1?"s":""]}),e.jsxs(a,{to:`/companies/${s}`,className:"inline-flex items-center gap-1 text-sm font-bold text-[#007ab7] hover:gap-2 transition-all",children:[e.jsx(S,{size:14})," ",t," companies"]})]})]})}),e.jsx("div",{className:"max-w-[1280px] mx-auto px-6 py-8",children:y?e.jsx("div",{className:"flex justify-center py-20",children:e.jsx(b,{className:"animate-spin text-[#007ab7]",size:32})}):w?e.jsx("p",{className:"text-center text-gray-400 py-20",children:"Couldn't load news. Please try again."}):x.length===0?e.jsxs("div",{className:"text-center py-20",children:[e.jsx(N,{size:40,className:"text-gray-200 mx-auto mb-3"}),e.jsx("p",{className:"text-gray-400",children:"No news yet for this sector."}),e.jsxs(a,{to:`/companies/${s}`,className:"mt-3 inline-block text-sm font-bold text-[#007ab7]",children:["â Back to ",t||"sector"]})]}):e.jsxs(e.Fragment,{children:[e.jsx(L,{items:x}),e.jsxs("div",{ref:u,className:"mt-8",children:[m&&e.jsx("div",{className:"flex justify-center py-6",children:e.jsx(b,{className:"animate-spin text-gray-300",size:28})}),!d&&e.jsx("p",{className:"text-center text-gray-300 text-xs uppercase tracking-widest py-6",children:"You've reached the end"}),d&&!m&&e.jsx("div",{className:"flex justify-center",children:e.jsx("button",{onClick:v,className:"text-sm font-bold text-[#007ab7]",children:"Load more"})})]})]})})]})};export{R as SectorNewsPage};
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.