import{r as p,j as s,L as N,aK as h}from"./index-DAC_nvu_.js";import{f as k,d as f}from"./selectors-BzGTQ3YA.js";import{S as w}from"./SEO-D3SqufAR.js";import{s as _}from"./Toast-qkLTujD4.js";import{s as v}from"./share_icon-DjRp4IpP.js";import{t as y}from"./timer_icon-BN-Yr58j.js";import{S as r}from"./Skeleton-B9qjVT1Z.js";import{s as u}from"./blogPage.module-BGz_ymqn.js";import"./info_icon-CdnwKllQ.js";const $="_card_15k1o_1",S="_imageWrapper_15k1o_21",b="_image_15k1o_21",A="_cardSmall_15k1o_35",M="_cardLarge_15k1o_39",L="_content_15k1o_43",T="_meta_15k1o_52",C="_mainMeta_15k1o_61",W="_dot_15k1o_68",B="_timeWrapper_15k1o_73",I="_clockIcon_15k1o_79",O="_cardContent_15k1o_85",E="_title_15k1o_92",D="_description_15k1o_97",R="_footer_15k1o_102",z="_tags_15k1o_109",F="_tag_15k1o_109",G="_shareBtn_15k1o_119",e={card:$,imageWrapper:S,image:b,cardSmall:A,cardLarge:M,content:L,meta:T,mainMeta:C,dot:W,timeWrapper:B,clockIcon:I,cardContent:O,title:E,description:D,footer:R,tags:z,tag:F,shareBtn:G},x={career:"Карьера Рё работа",training:"Обучение Рё траектории",hiring:"Найм Рё команды",research:"Рсследования",skills:"Навыки Рё развитие",all:"Блог"},P=({article:t,className:n})=>{const o=t.size==="large",i=p.useMemo(()=>x[t.category]||x.all,[t.category]),g=p.useMemo(()=>{if(t.createdAt.includes(".")){const a=t.createdAt.split(".");if(a.length>=2)return`${a[0]}.${a[1]}`}if(t.createdAt.includes("-")){const a=new Date(t.createdAt);if(!isNaN(a.getTime()))return`${String(a.getDate()).padStart(2,"0")}.${String(a.getMonth()+1).padStart(2,"0")}`}return t.createdAt},[t.createdAt]),j=async a=>{a.preventDefault(),a.stopPropagation();const m=`${window.location.origin}/blog/${t.id}`;if(window.matchMedia("(max-width: 768px)").matches&&navigator.share)try{await navigator.share({title:t.title,text:t.description,url:m})}catch(d){d.name!=="AbortError"&&console.log(d)}else try{await navigator.clipboard.writeText(m),_({children:"Ссылка скопирована РІ буфер обмена"})}catch{_({children:"РќРµ удалось скопировать ссылку"})}};return s.jsxs(N,{to:`/blog/${t.id}`,className:`${e.card} ${o?e.cardLarge:e.cardSmall} ${n||""}`,children:[s.jsx("div",{className:e.imageWrapper,children:s.jsx("img",{src:t.coverUrl,alt:t.title,className:e.image,loading:"lazy"})}),s.jsxs("div",{className:e.content,children:[s.jsxs("div",{className:`body-3 ${e.meta}`,children:[s.jsxs("div",{className:e.mainMeta,children:[s.jsx("span",{className:e.category,children:i}),s.jsx("span",{className:e.dot,children:"•"}),s.jsx("span",{className:e.date,children:g})]}),s.jsxs("span",{className:e.timeWrapper,children:[s.jsx("img",{src:y,alt:"",className:e.clockIcon}),t.readTime]})]}),s.jsxs("div",{className:e.cardContent,children:[s.jsx("h3",{className:`h2 ${e.title}`,children:t.title}),s.jsx("p",{className:`body-3 ${e.description}`,children:t.description})]}),s.jsxs("div",{className:e.footer,children:[s.jsx("div",{className:e.tags,children:t.tags.map(a=>s.jsx("span",{className:`body-3 ${e.tag}`,children:a},a))}),s.jsx("button",{className:e.shareBtn,onClick:j,"aria-label":"Поделиться статьей",children:s.jsx("img",{src:v,alt:"Share"})})]})]})]})},K=({className:t})=>s.jsxs("div",{className:`${e.card} ${t||""}`,children:[s.jsx("div",{className:e.imageWrapper,children:s.jsx(r,{height:"198px",width:"100%",animated:!0})}),s.jsxs("div",{className:e.content,children:[s.jsxs("div",{className:e.meta,children:[s.jsx("div",{className:e.mainMeta,children:s.jsx(r,{width:"120px",height:"18px"})}),s.jsx(r,{width:"40px",height:"18px"})]}),s.jsxs("div",{className:e.cardContent,children:[s.jsx(r,{width:"90%",height:"28px"}),s.jsx(r,{lines:2,width:"100%",height:"16px",lineGap:"8px"})]}),s.jsxs("div",{className:e.footer,children:[s.jsxs("div",{className:e.tags,children:[s.jsx(r,{width:"70px",height:"24px",style:{borderRadius:"32px"}}),s.jsx(r,{width:"50px",height:"24px",style:{borderRadius:"32px"}})]}),s.jsx(r,{variant:"circle",width:"24px",className:e.shareBtn})]})]})]}),U="_grid_1o8yk_1",Y="_spanOne_1o8yk_9",q="_spanTwo_1o8yk_13",c={grid:U,spanOne:Y,spanTwo:q},H=({articles:t,isLoading:n})=>n?s.jsx("div",{className:c.grid,children:Array.from({length:6}).map((o,i)=>s.jsx(K,{className:i===2?c.spanTwo:c.spanOne},i))}):s.jsx("div",{className:c.grid,children:t.map(o=>s.jsx(P,{article:o,className:o.size==="large"?c.spanTwo:c.spanOne},o.id))}),J="_wrapper_1jgfl_1",Q="_content_1jgfl_16",V="_title_1jgfl_24",X="_text_1jgfl_29",l={wrapper:J,content:Q,title:V,text:X},Z=()=>s.jsx("div",{className:l.wrapper,children:s.jsxs("div",{className:l.content,children:[s.jsx("h1",{className:`${l.title} h2`,children:"Р’ этом разделе РїРѕРєР° пусто"}),s.jsx("p",{className:`${l.text} body-1`,children:"РњС‹ готовим новые материалы РЅР° эту важную тему. РџРѕРєР° можете изучить РґСЂСѓРіРёРµ разделы нашего блога — там точно найдётся что-то полезное."})]})}),ds=()=>{const t=h(k),n=h(f);return s.jsxs(s.Fragment,{children:[s.jsx(w,{title:"Блог",description:"Блог Рѕ карьере, работе Рё развитии"}),t.length===0&&!n?s.jsx(Z,{}):s.jsx(H,{articles:t,isLoading:n}),s.jsx("p",{className:`body-3 ${u.layoutText}`,children:"Р’ этом блоге РІС‹ найдете статьи РїСЂРѕ карьеру Рё РЅРµ только"})]})};export{ds as BlogFeed};