How to change the className of a component based on a set of conditions, which results in conditional styling of components.