Hi I would imagine if you don’t have too many categories without sub categories. You could use a condition.
Ie If category is not cat1, Cat2. then your code for hiding main cat from composer.
If the opposite change to if catX, Cat,Y then your code.
Which spot do we need to put this when creating the component?