import{j as e}from"./jsx-runtime.D_zvdyIk.js";import{u as f}from"./useTranslation.Dg7DwAC5.js";import{e as u}from"./route.D5BPSNZk.js";import{l as g}from"./utils.D6Ui05B2.js";import{s as i,c as h}from"./utils.BZbvJs_N.js";import"./index.RTTH55m1.js";import"./index.BIRwh3HZ.js";import"./_commonjsHelpers.CqkleIqs.js";import"./index.3whys8t3.js";import"./router.B9yJslVs.js";import"./site.Deo0TYgJ.js";import"./site-config.CgQ_bxrG.js";function T({posts:o,fallbackPool:s,fallbackCount:a,startIndex:n=6,locale:m}){const{t:c}=f(),r=o.length>0,d=s.length<=a?i(s):i(s).slice(0,a),l=r?o:d,x=r?c("post.relatedPosts"):"";return l.length===0?null:e.jsxs("div",{className:"flex flex-col gap-4",children:[e.jsx("h2",{className:"font-semibold text-2xl text-foreground/80",children:x}),e.jsx("div",{className:h("flex flex-col gap-2",{"-mt-4 pt-12 md:-mt-5 md:pt-0":!r}),children:l.map((t,p)=>e.jsxs("a",{href:g(`/post/${u(t.link??t.slug)}`,m),className:"group flex gap-3 rounded-md p-2 text-sm transition-colors duration-300 hover:bg-foreground/5 hover:text-primary",children:[e.jsx("span",{className:"shrink-0 font-mono text-foreground/30",children:p+(r?1:n)}),e.jsxs("div",{className:"flex min-w-0 flex-col gap-0.5",children:[t.categoryName&&e.jsx("div",{className:"truncate text-foreground/50 text-xs",children:t.categoryName}),e.jsx("div",{className:"line-clamp-2 text-foreground/80 transition-colors group-hover:text-primary",children:t.title})]})]},t.slug))})]})}export{T as default};
