Overview
useModerateSpaceEntity returns a callable function for taking moderation action on an entity in a space. Requires the caller to be a moderator or admin.
Usage Example
import { useModerateSpaceEntity } from "@replyke/react-js";
function EntityModerationActions({ spaceId, entityId }: { spaceId: string; entityId: string }) {
const moderate = useModerateSpaceEntity();
return (
<div>
<button onClick={() => moderate({ spaceId, entityId, action: "approve" })}>
Approve
</button>
<button onClick={() => moderate({ spaceId, entityId, action: "remove" })}>
Remove
</button>
</div>
);
}
Parameters
UUID of the space containing the entity.
UUID of the entity to moderate.
action
"approve" | "remove"
required
The moderation action to take.
Returns
A confirmation response from the server.
For integration guidance, see Moderation.