PageSourceSearch

https://andthoughts.com/assets/FollowList-CZuQR4lW.js

js andthoughts.com collected 2026-10-09 22:00:49 UTC 4,499 bytes, 1 lines download raw bytes

1import{r as b,j as e}from"./react-oP8cqJFW.js";import{u as j,d as v,L as N}from"./router-BqMuc5y6.js";import{c as m}from"./query-2Ep1yrI1.js";import{s as n,f as _,ac as F,A as k,m as q,n as L,b2 as A}from"./index-DHvy35rZ.js";import{A as C}from"./arrow-left-ChxApaex.js";import{m as P}from"./motion-SKSdPC_x.js";import"./supabase-KdB9RrlQ.js";const E=s=>m({queryKey:["follower-profiles",s],enabled:!!s,queryFn:async()=>{const{data:o,error:t}=await n.from("follows").select("follower_id").eq("following_id",s).eq("status","accepted");if(t)throw t;if(!o.length)return[];const r=o.map(a=>a.follower_id),{data:i,error:l}=await n.from("profiles").select("id, username, display_name, avatar_url, bio").in("id",r);if(l)throw l;return i||[]}}),T=s=>m({queryKey:["following-profiles",s],enabled:!!s,queryFn:async()=>{const{data:o,error:t}=await n.from("follows").select("following_id").eq("follower_id",s).eq("status","accepted");if(t)throw t;if(!o.length)return[];const r=o.map(a=>a.following_id),{data:i,error:l}=await n.from("profiles").select("id, username, display_name, avatar_url, bio").in("id",r);if(l)throw l;return i||[]}}),z=({profile:s})=>{const o=s.display_name.split(" ").map(t=>t[0]).join("").toUpperCase();return e.jsxs("div",{className:"flex items-center gap-3 px-4 py-3 hover:bg-muted/50 transition-colors",children:[e.jsxs(N,{to:`/${s.username}`,className:"flex items-center gap-3 flex-1 min-w-0",children:[e.jsxs(k,{className:"w-10 h-10",children:[e.jsx(q,{src:s.avatar_url||void 0}),e.jsx(L,{className:"bg-primary text-primary-foreground font-display font-semibold text-sm",children:o})]}),e.jsxs("div",{className:"flex-1 min-w-0",children:[e.jsx("p",{className:"font-display font-semibold text-sm text-foreground truncate",children:s.display_name}),e.jsxs("p",{className:"text-xs text-muted-foreground font-body truncate",children:["&",s.username]}),s.bio&&e.jsx("p",{className:"text-xs text-muted-foreground font-body mt-0.5 line-clamp-1",children:s.bio})]})]}),e.jsx(A,{targetUserId:s.id,size:"md"})]})},O=()=>{const s=j(),[o]=v(),t=o.get("tab")==="following"?"following":"followers",[r,i]=b.useState(t),{user:l}=_(),a=o.get("userId")||l?.id,f=!o.get("userId")||o.get("userId")===l?.id,{data:u}=m({queryKey:["target-profile-privacy",a],enabled:!!a&&!f,queryFn:async()=>{const{data:d}=await n.from("profiles").select("hide_followers, display_name").eq("id",a).single();return d}}),c=!f&&u?.hide_followers,{data:p=[],isLoading:g}=E(c?void 0:a),{data:w=[],isLoading:h}=T(c?void 0:a),x=r==="followers"?p:w,y=r==="followers"?g:h;return e.jsxs("div",{className:"min-h-screen bg-background",children:[e.jsxs("header",{className:"sticky top-0 z-20 bg-background/90 backdrop-blur-md border-b border-border pt-safe",children:[e.jsxs("div",{className:"max-w-2xl mx-auto px-4 py-3 flex items-center gap-3",children:[e.jsx("button",{onClick:()=>s(-1),className:"text-muted-foreground hover:text-foreground",children:e.jsx(C,{size:22})}),e.jsxs("div",{className:"flex items-center gap-0",children:[e.jsx("img",{src:F,alt:"&",className:"h-6 w-6 object-contain -mr-1 dark:brightness-0 dark:invert"}),e.jsx("h1",{className:"font-display font-bold text-lg text-foreground",children:"Connections"})]})]}),e.jsxs("div",{className:"max-w-2xl mx-auto px-4 flex",children:[e.jsx("button",{onClick:()=>i("followers"),className:`flex-1 py-2.5 text-sm font-display font-semibold transition-colors ${r==="followers"?"text-primary border-b-2 border-primary":"text-muted-foreground hover:text-foreground"}`,children:"Followers"}),e.jsx("button",{onClick:()=>i("following"),className:`flex-1 py-2.5 text-sm font-display font-semibold transition-colors ${r==="following"?"text-primary border-b-2 border-primary":"text-muted-foreground hover:text-foreground"}`,children:"Following"})]})]}),e.jsx("div",{className:"max-w-2xl mx-auto divide-y divide-border",children:c?e.jsx("div",{className:"text-center py-12",children:e.jsx("p",{className:"text-muted-foreground font-body text-sm",children:"This user has hidden their connections list."})}):y?e.jsx("div",{className:"text-center py-12",children:e.jsx("p",{className:"text-muted-foreground font-body text-sm",children:"Loading..."})}):x.length===0?e.jsx("div",{className:"text-center py-12",children:e.jsx("p",{className:"text-muted-foreground font-body text-sm",children:r==="followers"?"No followers yet":"Not following anyone yet"})}):x.map(d=>e.jsx(P.div,{initial:{opacity:0}
1,animate:{opacity:1},children:e.jsx(z,{profile:d})},d.id))})]})};export{O 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.