Could probably make this more readable by flipping the order and using an if/else if chain to set the icon once.