34 lines
1.1 KiB
TypeScript
34 lines
1.1 KiB
TypeScript
import Subtitle from "@/components/TempDesignSystem/Text/Subtitle"
|
|
import { getIntl } from "@/i18n"
|
|
|
|
import ContactRow from "./ContactRow"
|
|
|
|
import styles from "./contact.module.css"
|
|
|
|
import { JoinLoyaltyContactTypenameEnum } from "@/types/components/content/enums"
|
|
import type { ContactProps } from "@/types/components/content/sidebar"
|
|
|
|
export default async function Contact({ contactBlock }: ContactProps) {
|
|
const { formatMessage } = await getIntl()
|
|
return (
|
|
<article className={styles.contactContainer}>
|
|
<Subtitle>{formatMessage({ id: "Contact us" })}</Subtitle>
|
|
<section className={styles.contact}>
|
|
{contactBlock.map(({ contact, __typename }, i) => {
|
|
switch (__typename) {
|
|
case JoinLoyaltyContactTypenameEnum.ContentPageSidebarJoinLoyaltyContactBlockContactContact:
|
|
return (
|
|
<ContactRow
|
|
key={`${contact.display_text}-${i}`}
|
|
contact={contact}
|
|
/>
|
|
)
|
|
default:
|
|
return null
|
|
}
|
|
})}
|
|
</section>
|
|
</article>
|
|
)
|
|
}
|