Always strive to make componenets as reusabule as possible. this might come at the drawback of making parent components longer, but the idea is to reduce context on each component so they can be used anywhere.

pass in props ā€˜onClick’ instead of ā€˜setModal’

because even though onClick will run ā€˜setModal’ in the parent function, this opens up the possibility to use this component elsewhere (maybe setModal isn’t used in that case).