Helping you creating modal and handling its various states for React app - compatible with typescript