PageSourceSearch

https://pipoly.app/assets/SaysActivity-Ct_QVm_C.js

js pipoly.app collected 2026-09-24 14:33:15 UTC 5,530 bytes, 1 lines download raw bytes

1import{j as e}from"./ui-vendor-7ksmbWQe.js";import{r as l,L as v}from"./react-vendor-LSUMIZ7H.js";import{j as N,ad as h}from"./index-BbjaYi6k.js";import{u as w,S}from"./SaysNav-DgOu6Z6B.js";import{S as _}from"./SaysTopBar-0rWakILI.js";import{B as f}from"./saysChannels-DJ0mqe43.js";import{R as I,a as y,C as M}from"./poll-card-icons-lmY6Wqdu.js";import{S as k}from"./analytics-icons-FBKatZTp.js";import{S as R}from"./shared-icons-DigiUiQH.js";import{u as g}from"./i18n-vendor-Cq4PMOpV.js";import"./action-menu-icons-GSCGJO6o.js";import"./popover-BjZgfnIK.js";import"./house-D6MYT8K4.js";function A(t){const r=Math.floor((Date.now()-new Date(t).getTime())/1e3);return r<60?`${r}s`:r<3600?`${Math.floor(r/60)}m`:r<86400?`${Math.floor(r/3600)}h`:r<86400*7?`${Math.floor(r/86400)}d`:new Date(t).toLocaleDateString(void 0,{month:"short",day:"numeric"})}function C(t){const r=new Date(t),c=new Date;c.setHours(0,0,0,0);const a=new Date(r);a.setHours(0,0,0,0);const n=(c.getTime()-a.getTime())/864e5;return n<=0?"today":n===1?"yesterday":n<7?"week":n<30?"month":"earlier"}const E=["all","reply","mention","milestone"],L={all:"filterAll",reply:"filterReplies",mention:"filterMentions",milestone:"filterMilestones"};function G(){const{t}=g(),r=w(),[c,a]=l.useState(""),[n,p]=l.useState([]),[d,x]=l.useState(!0),[m,j]=l.useState("all");l.useEffect(()=>{let s=!1;return x(!0),N.saysActivity().then(i=>{s||p(i.items||[])}).catch(i=>console.error(i)).finally(()=>{s||x(!1)}),()=>{s=!0}},[]);const u=l.useMemo(()=>n.filter(s=>m==="all"?!0:m==="reply"?s.type==="reply"||s.type==="reply_to_me":s.type===m),[n,m]),b=l.useMemo(()=>{const s=new Map;for(const i of u){const o=C(i.created_at);s.has(o)||s.set(o,[]),s.get(o).push(i)}return Array.from(s.entries())},[u]);return e.jsxs("div",{className:"min-h-screen bg-muted/30 pb-24 lg:pl-56",children:[e.jsx(_,{visible:r,query:c,onQuery:a}),e.jsxs("main",{className:"max-w-2xl mx-auto",children:[e.jsxs("header",{className:"px-4 pt-4 pb-2 flex items-center gap-2",children:[e.jsx("span",{className:"inline-flex h-8 w-8 items-center justify-center rounded-full bg-primary/15 text-primary",children:e.jsx(f,{size:16})}),e.jsx("h1",{className:"text-lg font-bold tracking-tight",children:t("says.activity.title")}),n.length>0&&e.jsx("span",{className:"ml-auto text-xs font-semibold text-muted-foreground tabular-nums",children:n.length})]}),e.jsx("div",{className:"px-3 pt-1 pb-2 flex items-center gap-1.5 overflow-x-auto scrollbar-hide",children:E.map(s=>e.jsx("button",{onClick:()=>j(s),className:h("px-3 py-1 rounded-full text-[11px] font-bold tracking-wide uppercase transition-all flex-none",m===s?"bg-foreground text-background":"bg-muted/60 text-muted-foreground hover:bg-muted hover:text-foreground"),children:t(`says.activity.${L[s]}`)},s))}),d?e.jsx("div",{className:"flex justify-center py-16",children:e.jsx(R,{size:26,className:"text-muted-foreground"})}):u.length===0?e.jsxs("div",{className:"text-center py-16 px-6",children:[e.jsx("div",{className:"inline-flex h-14 w-14 items-center justify-center rounded-2xl bg-primary/15 text-primary ring-1 ring-primary/30 mb-3",children:e.jsx(f,{size:22})}),e.jsx("h2",{className:"font-bold text-base tracking-tight",children:t("says.activity.allCaughtUp")}),e.jsx("p",{className:"text-sm text-muted-foreground mt-1.5 max-w-xs mx-auto",children:t("says.activity.allCaughtUpBody")})]}):e.jsx("div",{children:b.map(([s,i])=>e.jsxs("section",{className:"mt-1",children:[e.jsx("h2",{className:"px-4 pt-3 pb-1 text-[10px] uppercase tracking-[0.18em] font-bold text-muted-foreground",children:t(`says.activity.bucket${s.charAt(0).toUpperCase()+s.slice(1)}`)}),e.jsx("ul",{className:"bg-card border-y border-border/50 divide-y divide-border/40",children:i.map(o=>e.jsx(D,{item:o},o.type+o.id))})]},s))})]}),e.jsx(S,{})]})}function D({item:t}){const{t:r}=g(),c=`/says/p/${t.poll_short_id}`,a=t.type==="milestone",n=a?k:t.type==="reply_to_me"?I:t.type==="mention"?y:y,p=a?"bg-primary/15 text-primary ring-primary/30":t.type==="mention"?"bg-blue-500/15 text-blue-600 ring-blue-500/30":"bg-primary/15 text-primary ring-primary/20",d=t.type==="reply"?r("says.activity.verbReplyPoll"):t.type==="reply_to_me"?r("says.activity.verbReplyComment"):t.type==="mention"?r("says.activity.verbMention"):r("says.activity.milestonePassed",{n:t.threshold});return e.jsx("li",{children:e.jsxs(v,{to:c,className:"flex items-start gap-3 px-4 py-3 hover:bg-muted/40 transition-colors",children:[e.jsxs("span",{className:h("relative flex-none h-9 w-9 rounded-full ring-1 inline-flex items-center justify-center",p),children:[e.jsx(n,{size:16}),!a&&t.avatar_url&&e.jsx("img",{src:t.avatar_url,alt:"",className:"absolute -bottom-1 -right-1 h-5 w-5 rounded-full object-cover ring-2 ring-card"})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsxs("p",{className:"text-sm leading-snug text-foreground",children:[!a&&e.jsxs(e.Fragment,{children:[e.jsxs("span",{className:"font-semibold",children:["@",t.display_id]})," ",e.jsx("span",{className:"text-muted-foreground",children:d})]}),a&&e.jsxs("span",{className:"inline-flex items-center gap-1 font-semibold",children:[e.jsx(M,{size:14,filled:!0,className:"text-primary"}),d]})]}
1),t.body&&e.jsx("p",{className:"text-[13px] text-foreground/80 mt-0.5 line-clamp-2",children:t.body}),e.jsxs("p",{className:"text-[12px] text-muted-foreground mt-0.5 truncate",children:[e.jsx("span",{className:"font-medium",children:t.poll_title}),e.jsx("span",{className:"mx-1.5",children:"·"}),A(t.created_at)]})]})]})})}export{G as default};

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.