import * as React from "react"
import Button from "@mui/material/Button"
export default function Counter(props: any) {
const [value, setValue] = React.useState(0);
const { label = 'Increment', ...otherProps } = props;
const propsAndValue = { ...props, value };
const onClick = () => setValue(value + 1);
React.useEffect(() => {
console.log("Value: " + propsAndValue.value);
}, [value]);
return <div {...otherProps}>
Value: {value}
<Button onClick={onClick}>{label}</Button>
</div>
}