39 lines
905 B
TypeScript
39 lines
905 B
TypeScript
"use client";
|
|
|
|
/**
|
|
* FollowListDrawer — the followers / following list for a profile. A thin
|
|
* wrapper over the generic virtualized UserListDrawer, wired to the
|
|
* relationships followers/following endpoints.
|
|
*/
|
|
|
|
import { relationships } from "@/lib/social";
|
|
import { UserListDrawer } from "@/components/social/user-list-drawer";
|
|
|
|
export type FollowMode = "followers" | "following";
|
|
|
|
export function FollowListDrawer({
|
|
open,
|
|
mode,
|
|
handle,
|
|
onClose,
|
|
}: {
|
|
open: boolean;
|
|
mode: FollowMode;
|
|
handle: string;
|
|
onClose: () => void;
|
|
}) {
|
|
return (
|
|
<UserListDrawer
|
|
open={open}
|
|
onClose={onClose}
|
|
title={mode === "followers" ? "Followers" : "Following"}
|
|
depsKey={`${mode}:${handle}`}
|
|
fetchPage={(params) =>
|
|
mode === "followers"
|
|
? relationships.followers(handle, params)
|
|
: relationships.following(handle, params)
|
|
}
|
|
/>
|
|
);
|
|
}
|