And here is a demo using a record, it’s likely the most cumbersome of all the variants.
To be honest I’d still use your solution, it’s simpler and more explicit, this way you won’t forget to define custom components when you add new “optional” ones.