diff --git a/thoughts-frontend/app/users/[username]/followers/page.tsx b/thoughts-frontend/app/users/[username]/followers/page.tsx new file mode 100644 index 0000000..4f8e41d --- /dev/null +++ b/thoughts-frontend/app/users/[username]/followers/page.tsx @@ -0,0 +1,33 @@ +import { cookies } from "next/headers"; +import { notFound } from "next/navigation"; +import { getFollowersList } from "@/lib/api"; +import { UserListCard } from "@/components/user-list-card"; + +interface FollowersPageProps { + params: { username: string }; +} + +export default async function FollowersPage({ params }: FollowersPageProps) { + const { username } = params; + const token = (await cookies()).get("auth_token")?.value ?? null; + + const followersData = await getFollowersList(username, token).catch( + () => null + ); + + if (!followersData) { + notFound(); + } + + return ( +
Users following @{username}.
+Users that @{username} follows.
+{user.bio}
+ {isOwnProfile && ( ++ No users to display. +
+ ); + } + + return ( +{user.displayName || user.username}
+@{user.username}
+