import { Comment, useHideCommentToggle } from '@lens-protocol/react-web';
function HideableComment({ comment }: { comment: Comment }) {
const { execute: toggle, loading } = useHideCommentToggle();
return (
<button onClick={() => toggle({ comment })} disabled={loading}>
{comment.hiddenByAuthor ? 'Unhide' : 'Hide'}
</button>
);
}
This hook enables the author of a publication to toggle the visibility of a comment on their publication.
You MUST be authenticated via useLogin to use this hook.