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 { DynamicContentEnum } from "@/types/enums/dynamicContent"
export default function DynamicContent({
dynamic_content,
firstItem,
}: DynamicContentProps) {
export default function DynamicContent(props: DynamicContentProps) {
return (
<Suspense fallback={<LoadingSpinner />}>
{renderDynamicComponent(dynamic_content, firstItem)}
<DynamicContentBlocks {...props} />
</Suspense>
)
}
function renderDynamicComponent(
dynamic_content: DynamicContentProps["dynamic_content"],
firstItem: DynamicContentProps["firstItem"]
) {
function DynamicContentBlocks(props: DynamicContentProps) {
const { dynamic_content, firstItem } = props
switch (dynamic_content.component) {
case DynamicContentEnum.Blocks.components.current_benefits:
return <CurrentRewardsBlock {...dynamic_content} />

View File

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