import { useNavigate } from "react-router-dom"; import type { BaseNonAdminUser } from "../../utils/types"; interface ModalProps { title: string; users: BaseNonAdminUser[]; onClose: () => void; onFollowToggle: (targetUsername: string) => Promise; } const UserListModal = ({ title, users, onClose, onFollowToggle, }: ModalProps) => { const navigate = useNavigate(); const baseURL = import.meta.env.VITE_API_BASE_URL; return (

{title}

{users.length === 0 ? (

No users found.

) : ( users.map((u) => (
{ onClose(); navigate(`/users/${u.username}`); }} >
{u.profilePhoto ? ( ) : ( {u.fullName.charAt(0)} )}

{u.fullName}

)) )}
); }; export default UserListModal;