How do i get the component using component ID

For a static set like this, you will need an equivalently long global init of a dictionary mapping the text keys into the component blocks of the text boxes that match those keys.

There's no avoiding that.

See this post for sample code, using a list based lookup table and a dictionary.