How to build an indeterminate checkbox in React