"use client";"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./index.cjs38.js"),h=require("./index.cjs40.js"),N=require("./index.cjs394.js"),y=require("./index.cjs395.js"),s=require("./index.cjs396.js"),g=require("./index.cjs397.js"),r=require("./index.cjs9.js"),w=require("./index.cjs398.js");function f(t){return t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${(t/1e3).toFixed(1)}K`:String(t)}function I(t){if(t<60)return`${t} мин`;const i=Math.floor(t/60),a=t%60;return a>0?`${i} ч ${a} мин`:`${i} ч`}function E({title:t,description:i,viewsCount:a,readingTimeMinutes:d,author:n,imageUrl:u,imageAlt:R,formattedDate:x,view:m,tags:l,href:p,showPlaceholder:v=!0,className:j}){if(m==="row")return e.jsxRuntimeExports.jsxs("div",{className:h(s.default.content,s.default["content--row"],j),children:[e.jsxRuntimeExports.jsx("div",{className:s.default.rowIcon,"aria-hidden":!0,children:e.jsxRuntimeExports.jsx(g.FileTextIcon,{size:24,strokeWidth:2})}),e.jsxRuntimeExports.jsxs("div",{className:s.default.rowBody,children:[l&&e.jsxRuntimeExports.jsx("div",{className:s.default.tagsSlotRow,onClick:o=>o.stopPropagation(),children:l}),e.jsxRuntimeExports.jsx(r.Typography,{variant:"h5",as:"h2",className:s.default.title,title:t,children:t}),e.jsxRuntimeExports.jsxs("div",{className:s.default.rowMeta,children:[e.jsxRuntimeExports.jsx(r.Typography,{variant:"caption",className:s.default.date,children:x}),a!=null&&e.jsxRuntimeExports.jsxs("span",{className:s.default.views,title:"Просмотры",children:[e.jsxRuntimeExports.jsx(w.EyeIcon,{size:14,strokeWidth:2}),e.jsxRuntimeExports.jsx("span",{children:f(a)})]})]})]})]});if(m==="card"){const o=e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[d!=null&&e.jsxRuntimeExports.jsxs("span",{className:s.default.readingTime,title:"Время чтения",children:[e.jsxRuntimeExports.jsx(y.AnimatedClockIcon,{size:14,className:s.default.clockIcon}),e.jsxRuntimeExports.jsx("span",{children:I(d)})]}),a!=null&&e.jsxRuntimeExports.jsxs("span",{className:s.default.views,title:"Просмотры",children:[e.jsxRuntimeExports.jsx(N.AnimatedEyeIcon,{size:14,className:s.default.eyeIcon}),e.jsxRuntimeExports.jsx("span",{children:f(a)})]})]});return e.jsxRuntimeExports.jsxs("div",{className:h(s.default.content,s.default["content--card"],j),children:[e.jsxRuntimeExports.jsxs("div",{className:s.default.cardBody,children:[n?e.jsxRuntimeExports.jsxs("div",{className:s.default.author,onClick:c=>c.stopPropagation(),children:[n.avatarUrl?e.jsxRuntimeExports.jsx("img",{src:n.avatarUrl,alt:"",className:s.default.authorAvatar,width:32,height:32}):e.jsxRuntimeExports.jsx("div",{className:s.default.authorAvatarPlaceholder,"aria-hidden":!0,children:n.name.charAt(0).toUpperCase()}),e.jsxRuntimeExports.jsx(r.Typography,{variant:"caption",className:s.default.authorName,children:n.name}),e.jsxRuntimeExports.jsx(r.Typography,{variant:"caption",className:s.default.date,children:x})]}):e.jsxRuntimeExports.jsx(r.Typography,{variant:"caption",className:s.default.date,children:x}),e.jsxRuntimeExports.jsx(r.Typography,{variant:"h5",as:"h2",className:s.default.title,title:t,children:t}),i&&e.jsxRuntimeExports.jsx(r.Typography,{variant:"caption",className:s.default.description,children:i}),e.jsxRuntimeExports.jsxs("div",{className:s.default.cardFooter,children:[l&&e.jsxRuntimeExports.jsx("div",{className:s.default.tagsSlotCard,onClick:c=>c.stopPropagation(),children:l}),p?e.jsxRuntimeExports.jsx("a",{href:p,className:s.default.meta,children:o}):e.jsxRuntimeExports.jsx("div",{className:s.default.meta,children:o})]})]}),u?e.jsxRuntimeExports.jsx("div",{className:s.default.previewWrap,children:e.jsxRuntimeExports.jsx("img",{src:u,alt:R||t,className:s.default.previewImage,decoding:"async",loading:"lazy"})}):v?e.jsxRuntimeExports.jsx("div",{className:s.default.previewWrap,children:e.jsxRuntimeExports.jsx("div",{className:s.default.previewPlaceholder,"aria-hidden":!0})}):null]})}return null}E.displayName="ArticlePreviewContent";exports.ArticlePreviewContent=E;
//# sourceMappingURL=index.cjs52.js.map
