Nest the rg inside a group and set visibility conditions to that group
You can also set that nested rg to be invisible when its inside rg is empty