import ManagePreferencesButton from "@/components/Profile/ManagePreferencesButton"
import Body from "@/components/TempDesignSystem/Text/Body"
import Subtitle from "@/components/TempDesignSystem/Text/Subtitle"
import { getIntl } from "@/i18n"
import { setLang } from "@/i18n/serverContext"

import styles from "./page.module.css"

import { LangParams, PageArgs } from "@/types/params"

export default async function CommunicationSlot({
  params,
}: PageArgs<LangParams>) {
  setLang(params.lang)

  const { formatMessage } = await getIntl()
  return (
    <section className={styles.container}>
      <article className={styles.content}>
        <Subtitle type="two" color="black">
          {formatMessage({ id: "My communication preferences" })}
        </Subtitle>
        <Body color="black">
          {formatMessage({
            id: "Tell us what information and updates you'd like to receive, and how, by clicking the link below.",
          })}
        </Body>
      </article>
      <ManagePreferencesButton />
    </section>
  )
}
