You could achieve this in various ways:
Hope this helps!
Agree with Radhika, using
Create two nanoflows for your use case and change color according to status
Based on experience, dynamic classes are acting different when used in this scenario.