|
1 |
| -import { useItemsStore } from "../stores/itemsStore"; |
2 |
| -import Button from "./Button"; |
| 1 | +import { useItemsStore } from '../stores/itemsStore'; |
| 2 | +import Button from './Button'; |
3 | 3 |
|
4 | 4 | export default function ButtonGroup() {
|
5 | 5 | const markAllAsComplete = useItemsStore((state) => state.markAllAsComplete);
|
6 |
| - const markAllAsIncomplete = useItemsStore( |
7 |
| - (state) => state.markAllAsIncomplete |
8 |
| - ); |
| 6 | + const markAllAsIncomplete = useItemsStore((state) => state.markAllAsIncomplete); |
9 | 7 | const resetToInitial = useItemsStore((state) => state.resetToInitial);
|
10 | 8 | const removeAllItems = useItemsStore((state) => state.removeAllItems);
|
11 | 9 |
|
12 | 10 | const secondaryButtons = [
|
13 | 11 | {
|
14 |
| - text: "Mark all as complete", |
| 12 | + text: 'Mark all as complete', |
15 | 13 | onClick: markAllAsComplete,
|
16 | 14 | },
|
17 | 15 | {
|
18 |
| - text: "Mark all as incomplete", |
| 16 | + text: 'Mark all as incomplete', |
19 | 17 | onClick: markAllAsIncomplete,
|
20 | 18 | },
|
21 | 19 | {
|
22 |
| - text: "Reset to initial", |
| 20 | + text: 'Reset to initial', |
23 | 21 | onClick: resetToInitial,
|
24 | 22 | },
|
25 | 23 | {
|
26 |
| - text: "Remove all items", |
| 24 | + text: 'Remove all items', |
27 | 25 | onClick: removeAllItems,
|
28 | 26 | },
|
29 | 27 | ];
|
30 | 28 |
|
31 | 29 | return (
|
32 |
| - <section className="button-group"> |
| 30 | + <section className='button-group'> |
33 | 31 | {secondaryButtons.map((button) => (
|
34 | 32 | <Button
|
35 | 33 | key={button.text + button.onClick.toString()}
|
36 |
| - text={button.text} |
37 | 34 | onClick={button.onClick}
|
38 |
| - buttonType="secondary" |
39 |
| - /> |
| 35 | + buttonType='secondary' |
| 36 | + > |
| 37 | + {button.text} |
| 38 | + </Button> |
40 | 39 | ))}
|
41 | 40 | </section>
|
42 | 41 | );
|
|
0 commit comments