Files
Compass/web/components/gender-icon.tsx
Martin Braquet ba9b3cfb06 Add pretty formatting (#29)
* Test

* Add pretty formatting

* Fix Tests

* Fix Tests

* Fix Tests

* Fix

* Add pretty formatting fix

* Fix

* Test

* Fix tests

* Clean typeckech

* Add prettier check

* Fix api tsconfig

* Fix api tsconfig

* Fix tsconfig

* Fix

* Fix

* Prettier
2026-02-20 17:32:27 +01:00

54 lines
1.4 KiB
TypeScript

import clsx from 'clsx'
import {type Gender} from 'common/gender'
import {BsFillPersonFill} from 'react-icons/bs'
import {
PiGenderFemaleBold,
PiGenderMaleBold,
PiGenderNonbinaryBold,
PiGenderTransgenderBold,
} from 'react-icons/pi'
export default function GenderIcon(props: {gender: Gender; className: string; hasColor?: boolean}) {
const {gender, className, hasColor} = props
if (gender == 'male') {
return (
<PiGenderMaleBold
className={clsx(className, hasColor ? 'text-blue-500 dark:text-blue-300' : '')}
/>
)
}
if (gender == 'female') {
return (
<PiGenderFemaleBold
className={clsx(className, hasColor ? 'text-pink-500 dark:text-pink-300' : '')}
/>
)
}
if (gender == 'non-binary') {
return (
<PiGenderNonbinaryBold
className={clsx(className, hasColor ? 'text-purple-500 dark:text-purple-300' : '')}
/>
)
}
if (gender == 'trans-female') {
return (
<PiGenderTransgenderBold
className={clsx(className, hasColor ? 'text-pink-500 dark:text-pink-300' : '')}
/>
)
}
if (gender == 'trans-male') {
return (
<PiGenderTransgenderBold
className={clsx(className, hasColor ? 'text-blue-500 dark:text-blue-300' : '')}
/>
)
}
return (
<BsFillPersonFill
className={clsx(className, hasColor ? 'text-blue-500 dark:text-blue-300' : '')}
/>
)
}