IBM interview question

to build a react component