2 lines
1.6 KiB
JavaScript
2 lines
1.6 KiB
JavaScript
import{b as c,a4 as o,u as x,j as s,a3 as d,C as u}from"./ui-library-DpZprY9x.js";import{u as p,a as g}from"./react-vendor-Y0eyvj1J.js";import{u as h,N as f}from"./use-news-DRGMJQe9.js";import{u as j}from"./use-scroll-top-DE9DNB_I.js";const N=(t,r)=>{const{data:n,isPending:e}=c({queryKey:["news-inner",t,r],queryFn:()=>o(t,r),select:({data:l})=>l.data});return{data:n,isPending:e}};function _(){var m;const{id:t}=p(),r=x(a=>a.lang),n=Number(t);j(n);const{data:e,isPending:l}=N(n,r),{data:i}=h(r);return l?s.jsx(d,{}):s.jsxs(u,{className:"pt-10 pb-20 md:pt-20 md:pb-[120px]",children:[s.jsxs("section",{className:"max-w-[888px] py-5 mx-auto flex flex-col md:gap-10 gap-6",children:[s.jsxs("div",{children:[s.jsx("h1",{className:"text-on_surface md:text-[32px] text-3xl leading-10 mb-2",children:e==null?void 0:e.title}),s.jsx("h4",{children:e==null?void 0:e.published_at.slice(0,10).split("-").reverse().join(".")})]}),s.jsx("div",{className:"w-full h-[300px] md:h-[480px]",children:s.jsx("img",{src:((m=e==null?void 0:e.featured_images[0])==null?void 0:m.path)||"",alt:"news image",className:"size-full object-cover"})}),s.jsx("div",{dangerouslySetInnerHTML:{__html:(e==null?void 0:e.content)??""},className:"news-inner md:text-lg flex flex-col gap-6 text-base md:medium normal text-on_surface_v"})]}),s.jsx("hr",{className:"mt-10 md:mb-20 mb-[60px]"}),s.jsxs("section",{children:[s.jsx("h2",{className:"h2 mb-6",children:r==="ru"?"Читайте также:":"Read more:"}),s.jsx("div",{className:"grid md:grid-cols-3 grid-cols-1 gap-6",children:i==null?void 0:i.filter(a=>a.id!==n).slice(0,3).map(a=>g.createElement(f,{...a,key:a.title}))})]})]})}export{_ as default};
|