Files
web/components/Header/MainMenu/Avatar/index.tsx
Linus Flood 0800c877a3 Merged in fix/hotjar-suppress-fixes (pull request #1192)
fix: hotjar - suppress personal data

* fix: hotjar - suppress personal data

* More suppressing
2025-02-04 06:47:36 +00:00

29 lines
863 B
TypeScript

import { PersonIcon } from "@/components/Icons"
import Image from "@/components/Image"
import Footnote from "@/components/TempDesignSystem/Text/Footnote"
import styles from "./avatar.module.css"
import type { AvatarProps } from "@/types/components/header/avatar"
export default function Avatar({ image, initials }: AvatarProps) {
let classNames = [styles.avatar]
let element = <PersonIcon color="white" />
if (image) {
classNames.push(styles.image)
element = <Image src={image.src} alt={image.alt} width={28} height={28} />
} else if (initials) {
classNames.push(styles.initials)
element = (
<Footnote type="label" color="white" textTransform="uppercase" asChild>
<span>{initials}</span>
</Footnote>
)
}
return (
<span data-hj-suppress className={classNames.join(" ")}>
{element}
</span>
)
}