2023-10-23 23:11:59 +02:00
|
|
|
"use client"
|
2023-07-30 18:50:14 +02:00
|
|
|
|
2023-10-23 23:11:59 +02:00
|
|
|
import { useMemo } from "react"
|
2021-04-18 01:56:23 +02:00
|
|
|
|
2023-10-23 23:11:59 +02:00
|
|
|
import { useI18n } from "@/i18n/i18n.client"
|
|
|
|
import { BIRTH_DATE, BIRTH_DATE_STRING, getAge } from "@/utils/getAge"
|
|
|
|
import type { CookiesStore } from "@/utils/constants"
|
2024-04-06 20:32:09 +02:00
|
|
|
import { useIsMounted } from "@/hooks/useIsMounted"
|
2022-03-24 11:45:19 +01:00
|
|
|
|
2023-10-23 23:11:59 +02:00
|
|
|
import { ProfileItem } from "./ProfileItem"
|
2021-04-18 01:56:23 +02:00
|
|
|
|
2023-07-31 19:06:46 +02:00
|
|
|
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
|
|
|
|
2022-03-24 18:57:27 +01:00
|
|
|
const age = useMemo(() => {
|
2023-05-30 21:51:27 +02:00
|
|
|
return getAge(BIRTH_DATE)
|
2022-03-24 18:57:27 +01:00
|
|
|
}, [])
|
|
|
|
|
2024-04-06 20:32:09 +02:00
|
|
|
const { isMounted } = useIsMounted()
|
|
|
|
|
2021-04-18 01:56:23 +02:00
|
|
|
return (
|
2023-10-23 23:11:59 +02:00
|
|
|
<ul className="m-0 list-none p-0">
|
2023-05-29 17:10:14 +02:00
|
|
|
<ProfileItem
|
2023-10-23 23:11:59 +02:00
|
|
|
title={i18n.translate("home.about.pronouns")}
|
|
|
|
value={i18n.translate("home.about.pronouns-value")}
|
2023-07-31 19:06:46 +02:00
|
|
|
/>
|
2024-05-16 10:06:43 +02:00
|
|
|
<ProfileItem
|
|
|
|
title={i18n.translate("home.about.birth-date")}
|
|
|
|
value={
|
|
|
|
isMounted
|
|
|
|
? `${BIRTH_DATE_STRING} (${age} ${i18n.translate(
|
|
|
|
"home.about.years-old",
|
|
|
|
)})`
|
|
|
|
: BIRTH_DATE_STRING
|
|
|
|
}
|
|
|
|
/>
|
|
|
|
|
2022-03-24 11:45:19 +01:00
|
|
|
<ProfileItem
|
2023-10-23 23:11:59 +02:00
|
|
|
title={i18n.translate("home.about.nationality")}
|
|
|
|
value="Alsace, France"
|
2022-03-24 11:45:19 +01:00
|
|
|
/>
|
2021-05-08 19:52:04 +02:00
|
|
|
<ProfileItem
|
2023-10-23 23:11:59 +02:00
|
|
|
title="Email"
|
|
|
|
value="contact@theoludwig.fr"
|
|
|
|
link="mailto:contact@theoludwig.fr"
|
2021-05-08 19:52:04 +02:00
|
|
|
/>
|
|
|
|
</ul>
|
2021-04-18 01:56:23 +02:00
|
|
|
)
|
|
|
|
}
|