diff --git a/src/components/Home/ToggleSwitcher.astro b/src/components/Home/ToggleSwitcher.astro index 0b4eac25..2ddc1ff5 100644 --- a/src/components/Home/ToggleSwitcher.astro +++ b/src/components/Home/ToggleSwitcher.astro @@ -12,64 +12,76 @@ import Spacer from './Spacer.astro'; // Props for sections let { sections } = Astro.props; -// Mapping for dynamic rendering -const componentMap : any = { - 'Skills': Skills, - 'Companies': Companies, - 'RecentProjects': RecentProjects, - 'Projects': Projects, - 'Education': Education, - 'Certificate': Certificate -}; ---
- {sections.map((section:any , index:any) => ( - - - {section.title} - - ))} + { + sections.map((section: any, index: any) => ( + + {' '} + + {section.title} + + )) + }

-{sections.map((section:any, index:any) => ( -
- {componentMap[section.component] ? :
Component not found
} -
-))} +{ + sections.map((section: any, index: any) => { + + return ( +
+ {section.component === 'Skills' && } + {section.component === 'Companies' && } + {section.component === 'RecentProjects' && } + {section.component === 'Projects' && } + {section.component === 'Education' && } + {section.component === 'Certificate' && } +
+ ); + }) +}