{
- setCurrentCameras([...conf.cameras]);
- }}
- />
- );
- })}
- >
- )}
-
- {allCameras.map((item) => (
+
{
if (isChecked) {
- const updatedCameras = currentCameras ? [...currentCameras] : [];
-
- updatedCameras.push(item);
- setCurrentCameras(updatedCameras);
- } else {
- const updatedCameras = currentCameras ? [...currentCameras] : [];
-
- // can not deselect the last item
- if (updatedCameras.length > 1) {
- updatedCameras.splice(updatedCameras.indexOf(item), 1);
- setCurrentCameras(updatedCameras);
- }
+ setCurrentCameras(undefined);
}
}}
/>
- ))}
+ {groups.length > 0 && (
+ <>
+
+ {groups.map(([name, conf]) => {
+ return (
+ {
+ setCurrentCameras([...conf.cameras]);
+ }}
+ />
+ );
+ })}
+ >
+ )}
+
+ {allCameras.map((item) => (
+ {
+ if (isChecked) {
+ const updatedCameras = currentCameras
+ ? [...currentCameras]
+ : [];
+
+ updatedCameras.push(item);
+ setCurrentCameras(updatedCameras);
+ } else {
+ const updatedCameras = currentCameras
+ ? [...currentCameras]
+ : [];
+
+ // can not deselect the last item
+ if (updatedCameras.length > 1) {
+ updatedCameras.splice(updatedCameras.indexOf(item), 1);
+ setCurrentCameras(updatedCameras);
+ }
+ }
+ }}
+ />
+ ))}
+
Filter Labels
- {
- if (isChecked) {
- setCurrentLabels(undefined);
- }
- }}
- />
-
- {allLabels.map((item) => (
+
{
if (isChecked) {
- const updatedLabels = currentLabels ? [...currentLabels] : [];
-
- updatedLabels.push(item);
- setCurrentLabels(updatedLabels);
- } else {
- const updatedLabels = currentLabels ? [...currentLabels] : [];
-
- // can not deselect the last item
- if (updatedLabels.length > 1) {
- updatedLabels.splice(updatedLabels.indexOf(item), 1);
- setCurrentLabels(updatedLabels);
- }
+ setCurrentLabels(undefined);
}
}}
/>
- ))}
+
+ {allLabels.map((item) => (
+ {
+ if (isChecked) {
+ const updatedLabels = currentLabels ? [...currentLabels] : [];
+
+ updatedLabels.push(item);
+ setCurrentLabels(updatedLabels);
+ } else {
+ const updatedLabels = currentLabels ? [...currentLabels] : [];
+
+ // can not deselect the last item
+ if (updatedLabels.length > 1) {
+ updatedLabels.splice(updatedLabels.indexOf(item), 1);
+ setCurrentLabels(updatedLabels);
+ }
+ }
+ }}
+ />
+ ))}
+