11import clsx from 'clsx'
22import { convertRace , convertRelationshipType , type RelationshipType , } from 'web/lib/util/convert-types'
33import stringOrStringArrayToText from 'web/lib/util/string-or-string-array-to-text'
4- import { ReactNode } from 'react'
4+ import React , { ReactNode } from 'react'
55import {
66 INVERTED_DIET_CHOICES ,
77 INVERTED_EDUCATION_CHOICES ,
@@ -10,7 +10,8 @@ import {
1010 INVERTED_POLITICAL_CHOICES ,
1111 INVERTED_RELATIONSHIP_STATUS_CHOICES ,
1212 INVERTED_RELIGION_CHOICES ,
13- INVERTED_ROMANTIC_CHOICES
13+ INVERTED_ROMANTIC_CHOICES ,
14+ RELATIONSHIP_ICONS
1415} from 'web/components/filters/choices'
1516import { BiSolidDrink } from 'react-icons/bi'
1617import { BsPersonHeart , BsPersonVcard } from 'react-icons/bs'
@@ -30,7 +31,7 @@ import {UserActivity} from "common/user";
3031import { ClockIcon } from "@heroicons/react/solid" ;
3132import { MAX_INT , MIN_INT } from "common/constants" ;
3233import { GiFruitBowl } from "react-icons/gi" ;
33- import { FaBriefcase , FaHandsHelping , FaStar } from "react-icons/fa" ;
34+ import { FaBriefcase , FaHandsHelping , FaHeart , FaStar } from "react-icons/fa" ;
3435
3536export function AboutRow ( props : {
3637 icon : ReactNode
@@ -79,10 +80,7 @@ export default function ProfileAbout(props: {
7980 >
8081 < Seeking profile = { profile } />
8182 < RelationshipType profile = { profile } />
82- < AboutRow
83- icon = { < BsPersonHeart className = "h-5 w-5" /> }
84- text = { profile . relationship_status ?. map ( v => INVERTED_RELATIONSHIP_STATUS_CHOICES [ v ] ) }
85- />
83+ < RelationshipStatus profile = { profile } />
8684 < Education profile = { profile } />
8785 < Occupation profile = { profile } />
8886 < AboutRow
@@ -207,6 +205,20 @@ function RelationshipType(props: { profile: Profile }) {
207205 )
208206}
209207
208+ function RelationshipStatus ( props : { profile : Profile } ) {
209+ const { profile} = props
210+ const relationship_status = profile . relationship_status ?? [ ]
211+ if ( relationship_status . length === 0 ) return
212+ const key = relationship_status [ 0 ] as keyof typeof RELATIONSHIP_ICONS
213+ const icon = RELATIONSHIP_ICONS [ key ] ?? FaHeart
214+ return (
215+ < AboutRow
216+ icon = { icon ? React . createElement ( icon , { className : 'h-5 w-5' } ) : null }
217+ text = { relationship_status ?. map ( v => INVERTED_RELATIONSHIP_STATUS_CHOICES [ v ] ) }
218+ />
219+ )
220+ }
221+
210222function Education ( props : { profile : Profile } ) {
211223 const { profile} = props
212224 const educationLevel = profile . education_level
0 commit comments