import Link from "next/link"; import { User, RemoteActor } from "@/lib/api"; import { UserAvatar } from "./user-avatar"; import { Card, CardContent, CardHeader, CardTitle } from "@/components/ui/card"; interface AllFriendsCardProps { localFriends: User[]; remoteFriends: RemoteActor[]; } export function AllFriendsCard({ localFriends, remoteFriends }: AllFriendsCardProps) { const total = localFriends.length + remoteFriends.length; if (total === 0) return null; const localSlice = localFriends.slice(0, 6); const remoteSlice = remoteFriends.slice(0, Math.max(0, 6 - localSlice.length)); return ( Friends {localSlice.map((friend) => (
{friend.displayName || friend.username} @{friend.username}
))} {remoteSlice.map((actor) => (
{actor.displayName || actor.handle} @{actor.handle}
federated
))} {total > 6 && ( See all {total} friends → )}
); }