'use client' import { AnimatePresence, motion } from 'motion/react' import Link from 'next/link' import { useEffect, useState } from 'react' import { topTweets } from 'shared-data/tweets' import { Button } from 'ui' import { TweetCard } from 'ui-patterns/TweetCard' const COLS = 5 const TWEETS_PER_PAGE = 15 // V-shape offsets: outer columns high, center lowest const COL_OFFSETS = [0, 60, 100, 60, 0] function distributeToColumns(tweets: typeof topTweets, cols: number) { const columns: (typeof topTweets)[] = Array.from({ length: cols }, () => []) tweets.forEach((tweet, i) => columns[i % cols].push(tweet)) return columns } export function CommunitySectionV2() { const [page, setPage] = useState(0) useEffect(() => { if (topTweets.length === 0) return const interval = setInterval(() => { setPage((p) => p + 1) }, 10000) return () => clearInterval(interval) }, []) if (topTweets.length === 0) return null const currentTweets = Array.from({ length: TWEETS_PER_PAGE }, (_, i) => { const idx = (page * TWEETS_PER_PAGE + i) % topTweets.length return topTweets[idx] }) const columns = distributeToColumns(currentTweets, COLS) return (
Discover what our community has to say about their Supabase experience.