1import{c as d,s as j,r as g,j as e,L as y,t as m}from"./index-CwyW69ES.js";import{u as w}from"./useQuery-DAG4kRip.js";import{c as i}from"./typography-DrR9cVZ9.js";import{B as s}from"./button-JEvSNvnr.js";import{A as v}from"./arrow-left-CpJ9aS7-.js";import{S as x}from"./share-2-ndkmUEeq.js";import{C as u,a as p}from"./copy-DQS-pLUD.js";import"./createLucideIcon-BwfpN3tD.js";function D(){const n=d.useParams().slug,h=d.useLoaderData(),{data:t}=w({queryKey:["article",n],queryFn:async()=>{const{data:f}=await j.from("articles").select("*").eq("slug",n).maybeSingle();return f},initialData:h}),[a,o]=g.useState(!1);if(!t)return null;const l=typeof window<"u"?window.location.href:"",c=async()=>{if(typeof navigator<"u"&&navigator.share)try{await navigator.share({title:t.title,text:t.excerpt??t.title,url:l});return}catch{}r()},r=async()=>{try{await navigator.clipboard.writeText(l),o(!0),m.success("Link copied"),setTimeout(()=>o(!1),2e3)}catch{m.error("Could not copy link")}};return e.jsxs("article",{className:"container-page py-16 max-w-4xl",children:[e.jsxs(y,{to:"/news",className:"inline-flex items-center gap-2 text-sm text-ink-muted hover:text-foreground transition-colors mb-8",children:[e.jsx(v,{size:16})," Back to newsroom"]}),e.jsx("time",{className:"text-xs uppercase tracking-wider text-primary-glow",children:t.published_at?new Date(t.published_at).toLocaleDateString("en-US",{month:"long",day:"numeric",year:"numeric"}):""}),e.jsx("h1",{className:"mt-3 font-display text-4xl lg:text-6xl font-bold leading-tight",children:i(t.title)}),t.excerpt&&e.jsx("p",{className:"mt-6 text-xl text-ink-muted leading-relaxed",children:i(t.excerpt)}),e.jsxs("div",{className:"mt-8 flex flex-wrap items-center justify-between gap-4 pb-6 border-b border-border",children:[t.author_name?e.jsxs("div",{className:"flex items-center gap-3",children:[t.author_avatar&&e.jsx("img",{src:t.author_avatar,alt:t.author_name,className:"w-12 h-12 rounded-full object-cover border border-border"}),e.jsxs("div",{children:[e.jsx("div",{className:"font-semibold",children:t.author_name}),t.author_title&&e.jsx("div",{className:"text-xs text-ink-muted uppercase tracking-wider",children:t.author_title})]})]}):e.jsx("div",{}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(s,{variant:"hero",size:"sm",onClick:c,children:[e.jsx(x,{size:14})," Share"]}),e.jsxs(s,{variant:"outline",size:"sm",onClick:r,children:[a?e.jsx(u,{size:14}):e.jsx(p,{size:14})," ",a?"Copied":"Copy link"]})]})]}),t.cover_image&&e.jsx("img",{src:t.cover_image,alt:t.title,className:"mt-10 w-full rounded-2xl"}),e.jsx("div",{className:"mt-10 whitespace-pre-line text-foreground/90 leading-relaxed text-lg",children:i(t.content)}),e.jsxs("div",{className:"mt-16 pt-8 border-t border-border flex flex-wrap items-center justify-between gap-4",children:[e.jsx("p",{className:"text-ink-muted text-sm",children:"Enjoyed this article? Share it with your network."}),e.jsxs("div",{className:"flex gap-2",children:[e.jsxs(s,{variant:"hero",size:"sm",onClick:c,children:[e.jsx(x,{size:14})," Share"]}),e.jsxs(s,{variant:"outline",size:"sm",onClick:r,children:[a?e.jsx(u,{size:14}):e.jsx(p,{size:14})," ",a?"Copied":"Copy link"]})]})]})]})}export{D as component};
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.