+ {Object.values(state).map(item => {
+ const labelId = `checkbox-list-label-${item?.label}`;
- return (
-
-
- dispatch({
- type: 'checkCategory',
- payload: item.label,
- })
- }
- >
-
-
-
-
- {item.options?.length ? (
- handleOpen(event, item.label)} />
- ) : (
- handleOpen(event, item.label)} />
- )}
-
-
-
- {Object.values(item.options).map(option => (
-
- dispatch({
- type: 'checkOption',
- payload: {
- subCategoryLabel: item.label,
- optionLabel: option.label,
- },
- })
- }
- >
-
-
+ {
+ await dispatch({
+ type: 'checkCategory',
+ payload: item.label,
+ });
+ handleChange();
+ }}
+ >
+
+
+
+
+ {Object.values(item.options).length ? (
+ <>
+ {item.isOpen ? (
+ handleOpen(event, item.label)}
/>
-
-
-
- ))}
-
-
-
- );
- })}
-
+ ) : (
+