Authentication Required
Please connect your wallet to view your following list.
import { useState, useMemo } from 'react'; import Header from '@/components/Header'; import Footer from '@/components/Footer'; import { FollowingList } from '@/components/ui/following-card'; import { Button } from '@/components/ui/button'; import { Badge } from '@/components/ui/badge'; import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/tabs'; import { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogTitle, AlertDialogTrigger, } from '@/components/ui/alert-dialog'; import { Post } from '@opchan/core'; import { Trash2, Users, FileText, } from 'lucide-react'; import { useAuth, useContent } from '@/hooks'; import PostCard from '@/components/PostCard'; const FollowingPage = () => { const { currentUser } = useAuth(); const { following, posts, unfollowUser, clearAllFollowing } = useContent(); const [activeTab, setActiveTab] = useState<'following' | 'feed'>('following'); // Get posts from followed users const followedAddresses = useMemo( () => following.map(f => f.followedAddress), [following] ); const followingPosts = useMemo( () => posts.filter(post => followedAddresses.includes(post.authorAddress)), [posts, followedAddresses] ); // Sort posts by timestamp (newest first) const sortedFollowingPosts = useMemo( () => [...followingPosts].sort((a, b) => b.timestamp - a.timestamp), [followingPosts] ); // Redirect to login if not authenticated if (!currentUser) { return (
Please connect your wallet to view your following list.
Manage the users you follow and see their posts in your personalized feed.
{following.length === 0 ? 'Follow some users to see their posts here.' : 'The users you follow haven\'t posted anything yet.'}