Remove placeholder content in feed

cgen-e181e9a2c78747e8b84853b040240bc1
This commit is contained in:
Builder.io 2025-10-01 00:57:19 +00:00
parent 88d4cd0bc9
commit 30704020b0

View file

@ -89,31 +89,8 @@ export default function Feed() {
comments: p.comments_count ?? 0,
};
});
// If no posts yet, fall back to recommended people as placeholders
if (mapped.length === 0) {
const recs = await aethexSocialService.listRecommended(
user?.id || "guest",
12,
);
const placeholders: FeedItem[] = recs.map((r: any) => ({
id: r.id,
authorId: r.id,
authorName: r.full_name || r.username || "User",
authorAvatar: r.avatar_url,
caption: r.bio || "",
mediaUrl: r.banner_url || r.avatar_url || null,
mediaType: r.banner_url?.match(/\.(mp4|webm|mov)(\?.*)?$/i)
? "video"
: r.banner_url || r.avatar_url
? "image"
: "none",
likes: Math.floor(Math.random() * 200) + 5,
comments: Math.floor(Math.random() * 30),
}));
setItems(placeholders);
} else {
setItems(mapped);
}
setItems(mapped);
} finally {
setIsLoading(false);
}