import { Profile, useRecommendProfileToggle } from '@lens-protocol/react-web';
function ProfileRecommendation({ profile }: { profile: Profile }) {
const { execute: toggle, loading } = useRecommendProfileToggle();
return (
<button onClick={() => toggle({ profile })} disabled={loading}>
{profile.peerToPeerRecommendedByMe ? `Remove recommendation` : `Recommend`}
</button>
);
}
This hook enables you to either recommend a peer profile or withdraw a previous recommendation.
You MUST be authenticated via useLogin to use this hook.