"use client"; /** * NewUsersStrip — the "new on the platform" discovery row at the top of the * home feed. Up to 5 accounts that joined in the last 24h, each rendered as a * card tile. The row scrolls horizontally (native touch/trackpad swipe + a * mouse drag-to-scroll affordance) and bleeds to the section's edges with a * gutter so tiles peek in from the sides. Renders nothing when empty. */ import { useRef } from "react"; import Link from "next/link"; import type { UserSummary } from "@/lib/social"; import { UserAvatar } from "@/components/ui/user-avatar"; export function NewUsersStrip({ users }: { users: UserSummary[] }) { const scrollRef = useRef(null); // Mouse drag-to-scroll. Touch/trackpad use native overflow scrolling, so we // only engage for mouse; `moved` suppresses the click that would otherwise // fire after a drag (and navigate to a profile). const drag = useRef({ down: false, startX: 0, startScroll: 0, moved: false }); if (users.length === 0) return null; function onPointerDown(e: React.PointerEvent) { if (e.pointerType !== "mouse") return; const el = scrollRef.current; if (!el) return; drag.current = { down: true, startX: e.clientX, startScroll: el.scrollLeft, moved: false, }; el.setPointerCapture(e.pointerId); } function onPointerMove(e: React.PointerEvent) { if (!drag.current.down) return; const el = scrollRef.current; if (!el) return; const dx = e.clientX - drag.current.startX; if (Math.abs(dx) > 4) drag.current.moved = true; el.scrollLeft = drag.current.startScroll - dx; } function onPointerUp(e: React.PointerEvent) { if (!drag.current.down) return; drag.current.down = false; scrollRef.current?.releasePointerCapture(e.pointerId); } function onClickCapture(e: React.MouseEvent) { if (drag.current.moved) { e.preventDefault(); e.stopPropagation(); } } return (

New to Prabhupāda Says

Welcome them by sending a follow request.

{/* Bleed to the section edges (-mx-5) but keep a px-5 gutter so the first/last tiles have breathing room as they scroll past. */}
{users.map((u) => ( {u.name} @{u.handle} ))}
); }