import { HexKey } from "@snort/system"; import { ReactNode } from "react"; import { FormattedMessage } from "react-intl"; import ProfilePreview, { ProfilePreviewProps } from "@/Components/User/ProfilePreview"; import useFollowsControls from "@/Hooks/useFollowControls"; import useLogin from "@/Hooks/useLogin"; import AsyncButton from "../Button/AsyncButton"; import messages from "../messages"; export interface FollowListBaseProps { pubkeys: HexKey[]; title?: ReactNode; showFollowAll?: boolean; className?: string; actions?: ReactNode; profilePreviewProps?: Omit; } export default function FollowListBase({ pubkeys, title, showFollowAll, className, actions, profilePreviewProps, }: FollowListBaseProps) { const control = useFollowsControls(); const login = useLogin(); async function followAll() { await control.addFollow(pubkeys); } return (
{(showFollowAll ?? true) && (
{title}
{actions} followAll()} disabled={login.readonly}>
)}
{pubkeys?.slice(0, 20).map(a => )}
); }