import { serverClient } from "@/lib/trpc/server" import { EmailIcon, PhoneIcon } from "@/components/Icons" import Body from "@/components/TempDesignSystem/Text/Body" import { getValueFromContactConfig } from "@/utils/contactConfig" import styles from "./contactRow.module.css" import type { ContactRowProps } from "@/types/components/loyalty/sidebar" export default async function ContactRow({ contact }: ContactRowProps) { const data = await serverClient().contentstack.base.contact() const val = getValueFromContactConfig(contact.contact_field, data) if (!val) { return null } let Icon = null if (contact.contact_field.includes("email")) { Icon = EmailIcon } else if (contact.contact_field.includes("phone")) { Icon = PhoneIcon } return (
{Icon ? : null} {contact.display_text} {val}
) }