feat: add mapping of benefits AccountPage
This commit is contained in:
@@ -1,14 +1,18 @@
|
||||
import { Lang } from "@/constants/languages"
|
||||
|
||||
import {
|
||||
AccountPageContentItem,
|
||||
ContentEntries,
|
||||
DynamicContent,
|
||||
DynamicContentComponents,
|
||||
} from "@/types/requests/myPages/accountpage"
|
||||
import { User } from "@/types/user"
|
||||
|
||||
import CurrentBenefitsBlock from "@/components/MyPages/Blocks/Benefits/CurrentLevel"
|
||||
import NextLevelBenefitsBlock from "@/components/MyPages/Blocks/Benefits/NextLevel"
|
||||
import Overview from "@/components/MyPages/Blocks/Overview"
|
||||
import Shortcuts from "@/components/MyPages/Blocks/Shortcuts"
|
||||
import UpcomingStays from "@/components/MyPages/Blocks/UpcomingStays"
|
||||
import UpcomingStays from "@/components/MyPages/Blocks/Stays/Upcoming"
|
||||
import { User } from "@/types/user"
|
||||
|
||||
function DynamicComponent({
|
||||
user,
|
||||
@@ -37,8 +41,20 @@ function DynamicComponent({
|
||||
case DynamicContentComponents.previous_stays:
|
||||
return null
|
||||
case DynamicContentComponents.upcoming_stays:
|
||||
return <UpcomingStays lang={lang} {...componentProps} />
|
||||
case DynamicContentComponents.current_benefits:
|
||||
return (
|
||||
<UpcomingStays lang={lang} stays={user.stays} {...componentProps} />
|
||||
<CurrentBenefitsBlock
|
||||
title={content.title}
|
||||
preamble={content.preamble}
|
||||
/>
|
||||
)
|
||||
case DynamicContentComponents.next_benefits:
|
||||
return (
|
||||
<NextLevelBenefitsBlock
|
||||
title={content.title}
|
||||
preamble={content.preamble}
|
||||
/>
|
||||
)
|
||||
default:
|
||||
return null
|
||||
|
||||
Reference in New Issue
Block a user