diff --git a/web/components/profile-about.tsx b/web/components/profile-about.tsx index 7effe74f..0ac02130 100644 --- a/web/components/profile-about.tsx +++ b/web/components/profile-about.tsx @@ -31,21 +31,32 @@ export function AboutRow(props: { icon: ReactNode text?: string | null | string[] preText?: string + suffix?: string | null }) { - const {icon, text, preText} = props - if (!text || text.length < 1) { + const {icon, text, preText, suffix} = props + if (!text?.length && !preText && !suffix) { return <>> } + let formattedText = '' + if (preText) { + formattedText += preText + } + if (text?.length) { + formattedText += stringOrStringArrayToText({ + text: text, + preText: preText, + asSentence: false, + capitalizeFirstLetterOption: true, + }) + } + if (suffix) { + formattedText += formattedText ? ` (${suffix})` : suffix + } return ( {icon} - {stringOrStringArrayToText({ - text: text, - preText: preText, - asSentence: false, - capitalizeFirstLetterOption: true, - })} + {formattedText} ) @@ -72,10 +83,7 @@ export default function ProfileAbout(props: { } text={profile.religion?.map(belief => REVERTED_RELIGION_CHOICES[belief])} - /> - } - text={profile.religious_beliefs} + suffix={profile.religious_beliefs} /> }