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