Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const handleRowCheckAction = (event, metaData) => {
event.preventDefault();
const newKeys = Utils.toggleArrayValue(checkedKeys, metaData.key);
const isMax = newKeys.length === rowCount;
setAllChecked(allChecked ? !isMax : isMax);
setCheckedKeys(isMax ? [] : newKeys);
};
const handleSectionToggle = (event, metaData) => {
event.preventDefault();
setCollapsedKeys(Utils.toggleArrayValue(collapsedKeys, metaData.key));
};
const handleRowToggle = (event, metaData) => {
event.preventDefault();
setSelectedKeys(Utils.toggleArrayValue(selectedKeys, metaData.key));
};