import { env } from "@/env/server"

import { getIntl } from "@/i18n"

import { Section } from "../Section"
import EmailSlot from "./Slots/Email"
import PersonalizationSlot from "./Slots/Personalization"

export async function CommunicationSettings() {
  const intl = await getIntl()

  return (
    <Section
      title={intl.formatMessage({
        id: "profile.communicationSettings",
        defaultMessage: "Communication settings",
      })}
    >
      <EmailSlot />
      {env.ENABLE_PROFILE_CONSENT && <PersonalizationSlot />}
    </Section>
  )
}
