How to remove component that is empty on dynamic page?

Yeah, in a way. It’s been a while since I worked on it so give me a moment to look at my code.