ServiceTitan interview question

Given React boilerplate code, fix and optimize the code