feat: add blocks for loyalty page
This commit is contained in:
34
components/Loyalty/Blocks/DynamicContent/index.tsx
Normal file
34
components/Loyalty/Blocks/DynamicContent/index.tsx
Normal file
@@ -0,0 +1,34 @@
|
||||
import Title from "@/components/Title"
|
||||
import {
|
||||
DynamicContentProps,
|
||||
LoyaltyComponent,
|
||||
LoyaltyComponentEnum,
|
||||
} from "@/types/components/loyalty/blocks"
|
||||
|
||||
function DynamicComponentBlock({ component }: { component: LoyaltyComponent }) {
|
||||
switch (component) {
|
||||
case LoyaltyComponentEnum.how_it_works:
|
||||
return <p>How it works</p>
|
||||
case LoyaltyComponentEnum.loyalty_levels:
|
||||
return <p>loyalty_levels</p>
|
||||
case LoyaltyComponentEnum.overview_table:
|
||||
return <p>overview_table</p>
|
||||
default:
|
||||
return null
|
||||
}
|
||||
}
|
||||
|
||||
export default function DynamicContent({
|
||||
dynamicContent,
|
||||
}: DynamicContentProps) {
|
||||
return (
|
||||
<section>
|
||||
<header>
|
||||
<Title level="h3">{dynamicContent.title}</Title>
|
||||
{dynamicContent.preamble ? <p>{dynamicContent.preamble}</p> : null}
|
||||
{dynamicContent.link ? <></> : null}
|
||||
</header>
|
||||
<DynamicComponentBlock component={dynamicContent.component} />
|
||||
</section>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user