1import{j as e}from"./vendor-editor-BX0sR0z-.js";import{h as b,r as n,L as d}from"./vendor-react-BPk9u-w4.js";import{w as j,h as N,o as v}from"./index-FZUSOwo2.js";import{w as _}from"./withLayout-CvTHwEDw.js";import{A as m}from"./AmanhaAdSlot-Frw468Od.js";import{G as x}from"./menu-BwlNRRqD.js";import{p,av as y}from"./vendor-icons-D7M_7Je-.js";import"./vendor-charts-Cf-ruFca.js";import"./vendor-ui-utils-Bbg69IUi.js";import"./vendor-graph-Df3mHyA7.js";import"./vendor-supabase-UBwEW4nm.js";import"./vendor-sonner-DPZ7yCFm.js";import"./vendor-helmet-C74EPpLp.js";const f=["22% 24%","78% 26%","50% 78%","26% 72%"],A=t=>`radial-gradient(circle at ${f[t.length%f.length]}, rgba(255,59,63,0.45), transparent 62%), linear-gradient(135deg, #0f172a 0%, #1e293b 100%)`,w={parana:{label:"Paraná",uf:"PR",description:"As principais notÃcias sobre economia e negócios no mercado paranaense."},"santa-catarina":{label:"Santa Catarina",uf:"SC",description:"As principais notÃcias sobre economia e negócios no mercado catarinense."},"rio-grande-do-sul":{label:"Rio Grande do Sul",uf:"RS",description:"As principais notÃcias sobre economia e negócios no mercado gaúcho."}},S=()=>{var c;const{slug:t}=b(),i=j(),r=(c=i==null?void 0:i.currentPortal)==null?void 0:c.id,s=t&&w[t],[l,g]=n.useState([]),[o,u]=n.useState(!0);return n.useEffect(()=>{if(!s||!r)return;document.title=`${s.label} | Grupo AMANHÃ`;let a=!1;return N.from("news_articles").select("id, title, slug, excerpt, featured_image, published_at, primary_category_slug").eq("portal_id",r).eq("status","published").or(`tags.cs.{${s.uf}},tags.cs.{${t}},primary_category_slug.eq.${t}`).order("published_at",{ascending:!1}).limit(24).then(({data:h})=>{a||g(h||[])}).finally(()=>{a||u(!1)}),()=>{a=!0}},[t,s,r]),s?e.jsxs("div",{className:"bg-slate-50 min-h-screen pb-20",children:[e.jsxs("section",{className:"bg-slate-900 text-white py-12 relative overflow-hidden",children:[e.jsx("div",{className:"absolute inset-0 opacity-10 bg-gradient-to-br from-[#ff3b3f] to-blue-500"}),e.jsxs("div",{className:"container mx-auto px-4 relative z-10",children:[e.jsxs("span",{className:"flex items-center gap-1 w-fit px-3 py-1 bg-[#ff3b3f]/20 text-[#ff3b3f] text-xs font-bold uppercase tracking-wider rounded-full mb-3",children:[e.jsx(p,{className:"w-3 h-3"})," Minha região"]}),e.jsx("h1",{className:"text-3xl sm:text-4xl md:text-5xl font-bold mb-2",children:s.label}),e.jsx("p",{className:"text-slate-300 max-w-2xl",children:s.description})]})]}),e.jsx("section",{className:"container mx-auto px-4 pt-8",children:e.jsx(m,{slotId:"amanha-page-top",format:"970x90"})}),e.jsxs("section",{className:"container mx-auto px-4 py-12",children:[o&&e.jsxs("div",{className:"text-center py-12",children:[e.jsx("div",{className:"w-10 h-10 border-4 border-[#ff3b3f] border-t-transparent rounded-full animate-spin mx-auto mb-3"}),e.jsx("p",{className:"text-slate-500",children:"Carregando notÃcias da região..."})]}),!o&&l.length===0&&e.jsxs("div",{className:"text-center py-20",children:[e.jsx(p,{className:"w-12 h-12 text-slate-300 mx-auto mb-4"}),e.jsx("h2",{className:"text-2xl font-bold text-slate-700 mb-2",children:"Em breve"}),e.jsxs("p",{className:"text-slate-500",children:["Estamos curando o conteúdo do ",s.label," para você."]})]}),!o&&l.length>0&&e.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:l.map(a=>e.jsxs(d,{to:v(a.slug,a.primary_category_slug,r),className:"flex flex-col group bg-white rounded-2xl border border-slate-200 overflow-hidden hover:shadow-lg hover:border-[#ff3b3f] transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-[#ff3b3f] focus-visible:ring-offset-2",children:[a.featured_image?e.jsx("div",{className:"aspect-video overflow-hidden",children:e.jsx("img",{src:a.featured_image,alt:a.title,loading:"lazy",className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500"})}):e.jsx("div",{className:"aspect-video flex items-center justify-center",style:{backgroundImage:A(a.title)},"aria-hidden":"true",children:e.jsx("span",{className:"text-sm font-black uppercase tracking-[0.22em] text-white/75",children:"AMANHÃ"})}),e.jsxs("div",{className:"p-5 flex flex-col flex-1",children:[a.primary_category_slug&&x[a.primary_category_slug]&&e.jsx("span",{className:"text-xs font-bold text-[#ff3b3f] uppercase tracking-wider mb-2 block",children:x[a.primary_category_slug]}),e.jsx("h3",{className:"font-bold text-slate-800 group-hover:text-[#ff3b3f] transition-colors line-clamp-3 mb-2",children:a.title}),a.excerpt&&e.jsx("p",{className:"text-sm text-slate-500 line-clamp-2 mb-3",children:a.excerpt}),e.jsxs("div",{className:"mt-auto flex items-center gap-1 text-xs text-slate-400",children:[e.jsx(y,{className:"w-3 h-3"})," ",new Date(a.published_at).toLocaleDateString("pt-BR")]})]})]},a.id))})]}),e.jsx("section",{className:"container mx-auto px-4 pb-8",children:e.jsx(m,{slotId:"amanha-page-footer",format:"970x90"})})]}):e.jsx("div",{className:"bg-slate-50 min-h-screen pb-20",children:e.jsxs("section",{className:"container mx-auto px-4 py-20 text-center",children:[e.jsx("h1",{className:"text-3xl font-bold text-slate-800 mb-4",children:"Região não encontrada"}),e.jsx(d,{to:"/",className:"text-[#ff3b3f] hover:underline",children:"Voltar para a home"})]})})},q=_(S);export{q 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.