PageSourceSearch

https://www.abbeytheatre.co.uk/assets/News-BUC3vLMx.js

js abbeytheatre.co.uk collected 2026-10-02 21:27:49 UTC 2,935 bytes, 1 lines download raw bytes

1import{r as n,s as m,f as b,be as j,j as s,S as N,H as _,a as w,F as y}from"./index-D6S94l3r.js";import{N as u}from"./NewsCard-2mZjeeUB.js";function T(){const[a,i]=n.useState([]),[g,h]=n.useState(!0);n.useEffect(()=>{x()},[]);const x=async()=>{try{const{data:e,error:c}=await m.from("news_articles").select("id, title, slug, excerpt, featured_image_url, featured_image_alt, published_at").eq("is_published",!0).order("published_at",{ascending:!1});if(c)throw c;const r=e||[];if(r.length>0){const{data:p}=await m.from("news_article_tags").select("article_id, news_tags(id, name, slug, color)").in("article_id",r.map(t=>t.id)),o={};(p||[]).forEach(t=>{t.news_tags&&(o[t.article_id]||=[]).push(t.news_tags)}),i(r.map(t=>({...t,tags:o[t.id]||[]})))}else i(r)}catch(e){console.error("Error fetching articles:",e)}finally{h(!1)}},d=a.slice(0,3),l=a.slice(3),f=n.useMemo(()=>{if(a.length!==0)return[b([{name:"News",href:"/news"}]),j("News & Updates — The Abbey Theatre",a.map(e=>({name:e.title,href:`/news/${e.slug}`})))]},[a]);return s.jsxs("div",{className:"min-h-screen bg-background",children:[s.jsx(N,{title:"News",description:"The latest news and updates from The Abbey Theatre, Nuneaton. Stay informed about upcoming shows, events, and theatre happenings.",canonicalPath:"/news",jsonLd:f}),s.jsx(_,{}),s.jsx("main",{className:"container mx-auto px-4 py-12",children:s.jsxs("div",{className:"max-w-6xl mx-auto",children:[s.jsxs("div",{className:"text-center mb-12",children:[s.jsx("h1",{className:"text-4xl font-bold text-foreground mb-4",children:"News & Updates"}),s.jsx("p",{className:"text-lg text-muted-foreground max-w-2xl mx-auto",children:"The latest from The Abbey Theatre"})]}),g?s.jsx("div",{className:"flex items-center justify-center py-12",children:s.jsx(w,{className:"h-8 w-8 animate-spin text-primary"})}):a.length===0?s.jsx("div",{className:"text-center py-12 bg-card rounded-lg border border-border",children:s.jsx("p",{className:"text-muted-foreground",children:"No news articles yet. Check back soon!"})}):s.jsxs(s.Fragment,{children:[d.length>0&&s.jsxs("section",{className:"mb-12",children:[s.jsx("h2",{className:"text-2xl font-semibold text-foreground mb-6",children:"Latest News"}),s.jsx("div",{className:"grid md:grid-cols-2 lg:grid-cols-3 gap-6",children:d.map(e=>s.jsx(u,{title:e.title,slug:e.slug,excerpt:e.excerpt,featuredImageUrl:e.featured_image_url,featuredImageAlt:e.featured_image_alt,publishedAt:e.published_at,variant:"featured",tags:e.tags},e.id))})]}),l.length>0&&s.jsxs("section",{children:[s.jsx("h2",{className:"text-2xl font-semibold text-foreground mb-6",children:"More News"}),s.jsx("div",{className:"grid md:grid-cols-2 gap-4",children:l.map(e=>s.jsx(u,{title:e.title,slug:e.slug,excerpt:e.excerpt,featuredImageUrl:e.featured_image_url,featuredImageAlt:e.featured_image_alt,publishedAt:e.published_at,variant:"compact",tags:e.tags},e.id))})]})]})]})}),s.jsx(y,{})]})}export{T 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.