-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathSetAllButtons.tsx
29 lines (27 loc) · 1011 Bytes
/
SetAllButtons.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
import useStore from "../store";
export default function SetAllButtons() {
const isGranular = false;
const targets = useStore((state) => state.targets);
return (
<div className="inline-flex w-full" role="group" aria-label="Set all targets buttons">
<button
className="p-1.5 w-full text-sm border rounded-s-lg border-gray-200 dark:border-slate-700 bg-white dark:bg-slate-800"
onClick={() => targets.setAll(true, isGranular)}
>
Enable All
</button>
<button
className="p-1.5 w-full text-sm border-t border-b border-gray-200 dark:border-slate-700 bg-white dark:bg-slate-800"
onClick={() => targets.setAll(false, isGranular)}
>
Disable All
</button>
<button
className="p-1.5 w-full text-sm border rounded-e-lg border-gray-200 dark:border-slate-700 bg-white dark:bg-slate-800"
onClick={() => targets.resetToDefaults(isGranular)}
>
Restore to Defaults
</button>
</div>
);
}