This commit is contained in:
Linus Flood
2024-10-28 09:16:58 +01:00
parent 687a110a39
commit f5798562cc
2 changed files with 8 additions and 15 deletions

View File

@@ -21,21 +21,16 @@ import LoadingSpinner from "@/components/LoadingSpinner"
import type { DynamicContentProps } from "@/types/components/blocks/dynamicContent" import type { DynamicContentProps } from "@/types/components/blocks/dynamicContent"
import { DynamicContentEnum } from "@/types/enums/dynamicContent" import { DynamicContentEnum } from "@/types/enums/dynamicContent"
export default function DynamicContent({ export default function DynamicContent(props: DynamicContentProps) {
dynamic_content,
firstItem,
}: DynamicContentProps) {
return ( return (
<Suspense fallback={<LoadingSpinner />}> <Suspense fallback={<LoadingSpinner />}>
{renderDynamicComponent(dynamic_content, firstItem)} <DynamicContentBlocks {...props} />
</Suspense> </Suspense>
) )
} }
function renderDynamicComponent( function DynamicContentBlocks(props: DynamicContentProps) {
dynamic_content: DynamicContentProps["dynamic_content"], const { dynamic_content, firstItem } = props
firstItem: DynamicContentProps["firstItem"]
) {
switch (dynamic_content.component) { switch (dynamic_content.component) {
case DynamicContentEnum.Blocks.components.current_benefits: case DynamicContentEnum.Blocks.components.current_benefits:
return <CurrentRewardsBlock {...dynamic_content} /> return <CurrentRewardsBlock {...dynamic_content} />

View File

@@ -12,11 +12,9 @@ export function preload() {
export default function Footer() { export default function Footer() {
return ( return (
<Suspense>
<footer> <footer>
<FooterNavigation /> <FooterNavigation />
<FooterDetails /> <FooterDetails />
</footer> </footer>
</Suspense>
) )
} }