feat(SW-543): update contact config function

This commit is contained in:
Fredrik Thorsson
2025-01-02 11:29:09 +01:00
parent 584bcccb77
commit eab1386ee7
6 changed files with 16 additions and 15 deletions

View File

@@ -16,8 +16,8 @@ export default async function ContactRow({ contact }: ContactRowProps) {
return null
}
const val = getValueFromContactConfig(contact.contact_field, data)
const footnote = getValueFromContactConfig(contact.selectTest, data)
const val = getValueFromContactConfig(data, contact.contact_field)
const footnote = getValueFromContactConfig(data, contact.phoneFootnote)
if (!val) {
return null
@@ -54,7 +54,9 @@ export default async function ContactRow({ contact }: ContactRowProps) {
{val}
</Link>
</div>
{footnote && <Footnote color="burgundy">{footnote}</Footnote>}
{footnote && contact.contact_field.includes("phone") && (
<Footnote color="burgundy">{footnote}</Footnote>
)}
</div>
)
}