Skip to content

:hedgehog: PostHog is the leading platform for building self-driving products. Our developer tools – AI observability, analytics, session replay, flags, experiments, error tracking, logs, and more – capture all the context agents need to diagnose problems, uncover opportunities, and ship fixes. Steer it all from Slack, web, desktop, or the MCP.

954 B
Raw Blame
import { IconLogomark } from '@posthog/icons'
import { Avatar, AvatarFallback, AvatarImage } from '@posthog/quill'

import { gravatarUrl } from 'lib/utils/gravatar'

interface QuillPersonAvatarProps {
    name: string
    email?: string
    size?: 'xs' | 'sm' | 'default'
    /** PostHog itself, or staff acting as the user, rather than a person. */
    system?: boolean
}

export function QuillPersonAvatar({ name, email, size = 'sm', system }: QuillPersonAvatarProps): JSX.Element {
    if (system) {
        return (
            <Avatar size={size}>
                <AvatarFallback>
                    <IconLogomark />
                </AvatarFallback>
            </Avatar>
        )
    }
    return (
        <Avatar size={size} className="ph-no-capture">
            {email && <AvatarImage src={gravatarUrl(email)} alt="" />}
            <AvatarFallback>{(name || email || '?').charAt(0).toUpperCase()}</AvatarFallback>
        </Avatar>
    )
}