({
id,
...props
})
| 2 | import Counter from "./Counter"; |
| 3 | |
| 4 | const CounterView = ({ |
| 5 | id, |
| 6 | ...props |
| 7 | }) => { |
| 8 | const handleButton = event => { |
| 9 | event.stopPropagation(); |
| 10 | } |
| 11 | const editor = useEditor({ |
| 12 | id: id |
| 13 | }); |
| 14 | const { |
| 15 | handlePanel, |
| 16 | handleDragStart, |
| 17 | handleDragEnd, |
| 18 | } = editor; |
| 19 | return <DnDBuilder |
| 20 | onClick = {handlePanel} |
| 21 | onDragStart = {handleDragStart} |
| 22 | onDragEnd = {handleDragEnd} |
| 23 | draggable = {true} |
| 24 | > |
| 25 | <Counter |
| 26 | {...props} |
| 27 | onAdd = {handleButton} |
| 28 | onSubstract = {handleButton} |
| 29 | /> |
| 30 | </DnDBuilder> |
| 31 | } |
| 32 | |
| 33 | export default CounterView; |
nothing calls this directly
no test coverage detected