Hello! It's me again... It's becoming a regular occurrence... my apologies. 🥲 😅
To continue with my project based on my Headless CMS and Astro, I need a ComponentSwitcher to display the appropriate template according to the data I'm retrieving from my variable.
My variable can have 5 different values:
const template = 'Template 1' || 'Template 2' || 'Template 3' || 'Template 4' || 'Template 5';
Based on its value, I'd like to display the appropriate component.
Let's take a <Hero /> component for example:
If the template value = Template 1 , I display the <Hero1 /> component and so on.
My question is how to do this efficiently given that my variables come from my CMS API.
@primal field Florian has already given me a lead but I can't get it to work.
He said that maybe @umbral escarp could help me with this part? or someone else 😅
Thanks in advance !