import { useState } from "react";
/** Review comment ids whose suggestions will be committed together. */
export function useSuggestionBatch() {
const [ids, setIds] = useState<string[]>([]);
return {
ids,
has: (id: string) => ids.includes(id),
toggle: (id: string) =>
setIds((current) => (current.includes(id) ? current.filter((value) => value !== id) : [...current, id])),
clear: () => setIds([]),
};
}