1
1
mirror of https://github.com/theoludwig/theoludwig.git synced 2024-11-05 13:01:30 +01:00
.profile/components/Profile/ProfileList/index.tsx

48 lines
1.2 KiB
TypeScript
Raw Normal View History

'use client'
import { useMemo } from 'react'
2021-04-18 01:56:23 +02:00
import type { CookiesStore } from '@/i18n/i18n.client'
import { useI18n } from '@/i18n/i18n.client'
import { BIRTH_DATE, BIRTH_DATE_STRING, getAge } from '@/utils/getAge'
2021-04-18 01:56:23 +02:00
import { ProfileItem } from './ProfileItem'
export interface ProfileListProps {
cookiesStore: CookiesStore
}
export const ProfileList = (props: ProfileListProps): JSX.Element => {
const { cookiesStore } = props
const i18n = useI18n(cookiesStore)
2021-04-18 01:56:23 +02:00
const age = useMemo(() => {
return getAge(BIRTH_DATE)
}, [])
2021-04-18 01:56:23 +02:00
return (
2021-12-04 15:52:51 +01:00
<ul className='m-0 list-none p-0'>
<ProfileItem
title={i18n.translate('home.about.pronouns')}
value={i18n.translate('home.about.pronouns-value')}
/>
<ProfileItem
title={i18n.translate('home.about.birth-date')}
value={`${BIRTH_DATE_STRING} (${age} ${i18n.translate(
'home.about.years-old'
)})`}
/>
<ProfileItem
title={i18n.translate('home.about.nationality')}
value='Alsace, France'
/>
<ProfileItem
title='Email'
value='contact@theoludwig.fr'
link='mailto:contact@theoludwig.fr'
/>
</ul>
2021-04-18 01:56:23 +02:00
)
}