1
1
mirror of https://github.com/theoludwig/theoludwig.git synced 2024-11-12 23:33:14 +01:00
.profile/components/Interests/InterestsList/index.tsx

30 lines
748 B
TypeScript
Raw Normal View History

2024-01-23 23:59:10 +01:00
import { getI18n } from "@/i18n/i18n.server"
2021-04-18 01:56:23 +02:00
2024-01-23 23:59:10 +01:00
import {
InterestsIcons,
type InterestParagraphProps,
} from "../InterestParagraph"
import { InterestItem } from "./InterestItem"
2021-04-18 01:56:23 +02:00
export const InterestsList = (): JSX.Element => {
2024-01-23 23:59:10 +01:00
const i18n = getI18n()
let paragraphs = i18n.translate<InterestParagraphProps[]>(
"home.interests.paragraphs",
)
if (!Array.isArray(paragraphs)) {
paragraphs = []
}
2021-04-18 01:56:23 +02:00
return (
<div className="my-4 flex justify-center">
<ul className="m-0 flex w-96 list-none justify-around p-0">
2024-01-23 23:59:10 +01:00
{paragraphs.map(({ title, id }) => {
const icon = InterestsIcons[id]
return <InterestItem key={id} title={title} fontAwesomeIcon={icon} />
})}
</ul>
</div>
2021-04-18 01:56:23 +02:00
)
}