import { Lang } from "@/constants/languages" import styles from "./contact.module.css" import { type ContactNode, Section } from "@/types/requests/asides/contact" export default function Contact({ sections, system: { locale } }: ContactNode) { if (!sections.length) { return null } const visitingAddressMessage = getVisitingAddressMessage(locale) return (
{sections.map((section, idx) => { switch (section.__typename) { case Section.ContactBlockSectionsExtraInfo: return

{section.extra_info.text}

case Section.ContactBlockSectionsMailingAddress: return (

{section.mailing_address.name}
{section.mailing_address.street}
{section.mailing_address.zip} {section.mailing_address.city}
{section.mailing_address.country}

) case Section.ContactBlockSectionsPhone: return (

{section.phone.title}

+{section.phone.number}
) case Section.ContactBlockSectionsTitle: return (

{section.title.text}

) case Section.ContactBlockSectionsVisitingAddress: return (

{visitingAddressMessage}: {section.visiting_address.street}{" "}

) default: return null } })}
) } function getVisitingAddressMessage(lang: Lang) { switch (lang) { case Lang.sv: return "Besöksadress" case Lang.en: return "Visiting address" case Lang.da: return "Besøgsadresse" case Lang.de: return "Besuchsadresse" case Lang.fi: return "Vierailuosoite" case Lang.no: return "Besøksadresse" default: return "" } }