Best way to handle global state and component state

I want this a state globally. and i want quantity and rate should pass it and calculate it there. what is the best way I can do this.
Screenshot_from_2024-01-31_11-31-41.png
Screenshot_from_2024-01-31_11-33-52.png
Was this page helpful?