import{u as c,Q as d,d as m,a as u}from"./useQuery-C5OEng6p.js";import{j as e,s as x,a as g,L as o,c as l,b as p}from"./index-BH-cN4KT.js";function w(t,s){return c({...t,enabled:!0,suspense:!0,throwOnError:m,placeholderData:void 0},d)}const h=["Welcome to Malawi Today — your trusted source for national news"];function j(){const{data:t}=u({queryKey:["breaking-ticker"],queryFn:async()=>{const{data:n,error:r}=await x.from("breaking_news").select("message").eq("active",!0).order("priority",{ascending:!1});if(r)throw r;return n.map(i=>i.message)},staleTime:6e4}),s=t&&t.length>0?t:h,a=[...s,...s];return e.jsx("div",{className:"bg-brand-accent text-white py-2 overflow-hidden",children:e.jsxs("div",{className:"container mx-auto px-4 flex items-center gap-4",children:[e.jsx("span",{className:"font-bold uppercase tracking-tight text-[11px] whitespace-nowrap bg-white/20 px-2 py-0.5 rounded shrink-0",children:"Breaking"}),e.jsx("div",{className:"flex-1 overflow-hidden relative",children:e.jsx("div",{className:"flex gap-10 animate-ticker whitespace-nowrap will-change-transform",children:a.map((n,r)=>e.jsxs("span",{className:"text-sm font-medium",children:["• ",n]},r))})})]})})}function N({article:t,variant:s="default"}){const a=g(t.image);return s==="compact"?e.jsxs(o,{to:"/article/$slug",params:{slug:t.slug},className:"group block",children:[e.jsx("h4",{className:"font-bold leading-tight mb-1 group-hover:text-brand-accent",children:t.title}),e.jsxs("span",{className:"text-[10px] text-muted-foreground uppercase font-bold tracking-tight",children:[l(t.category)," • ",p(t.publishedAt)]})]}):s==="horizontal"?e.jsxs(o,{to:"/article/$slug",params:{slug:t.slug},className:"group grid grid-cols-[120px_1fr] sm:grid-cols-[160px_1fr] gap-4",children:[e.jsx("img",{src:a,alt:t.imageAlt,loading:"lazy",width:400,height:300,className:"aspect-[4/3] object-cover rounded-sm bg-muted"}),e.jsxs("div",{children:[e.jsx("span",{className:"text-brand-accent font-bold text-[11px] uppercase tracking-widest",children:l(t.category)}),e.jsx("h4",{className:"font-serif font-bold text-lg leading-tight mt-1 group-hover:text-brand-accent",children:t.title}),e.jsx("p",{className:"text-xs text-muted-foreground mt-2 line-clamp-2",children:t.dek})]})]}):e.jsxs(o,{to:"/article/$slug",params:{slug:t.slug},className:"group block",children:[e.jsx("img",{src:a,alt:t.imageAlt,loading:"lazy",width:800,height:500,className:"w-full aspect-video object-cover rounded-sm bg-muted mb-4"}),e.jsx("span",{className:"text-brand-accent font-bold text-xs uppercase tracking-widest",children:l(t.category)}),e.jsx("h4",{className:"font-serif font-bold text-xl leading-tight mt-2 mb-2 group-hover:text-brand-accent",children:t.title}),e.jsx("p",{className:"text-sm text-muted-foreground line-clamp-2",children:t.dek})]})}function y(){return e.jsxs("section",{className:"bg-brand text-primary-foreground p-8 md:p-12 rounded-sm flex flex-col lg:flex-row items-center gap-8",children:[e.jsxs("div",{className:"flex-1",children:[e.jsx("h3",{className:"font-serif text-2xl md:text-3xl font-black mb-2 italic",children:"The Morning Malawian"}),e.jsx("p",{className:"text-white/70",children:"The most important stories in Malawi, delivered to your inbox every morning at 7:00 AM."})]}),e.jsxs("form",{onSubmit:t=>t.preventDefault(),className:"flex-1 w-full flex flex-col sm:flex-row gap-2",children:[e.jsx("input",{type:"email",required:!0,placeholder:"your@email.com",className:"flex-1 bg-white/10 border border-white/20 px-4 py-3 rounded-sm outline-none focus:bg-white/20 placeholder:text-white/40 text-white transition-all"}),e.jsx("button",{className:"bg-brand-accent text-white px-8 py-3 font-bold rounded-sm whitespace-nowrap hover:opacity-90",children:"JOIN US"})]})]})}function v({label:t="Advertisement",height:s="h-64"}){return e.jsx("div",{className:`bg-muted w-full grid place-items-center text-xs text-muted-foreground font-bold uppercase tracking-widest border border-border rounded-sm ${s}`,children:t})}export{N as A,j as B,y as N,v as a,w as u};
