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.

923 B
Raw Blame
import { useState } from 'react'

export function ConnectedAppLogo({ name, logoUri }: { name: string; logoUri: string | null }): JSX.Element {
    // A CIMD app without a logo of its own gets its host's touch icon, which may not exist
    const [logoFailed, setLogoFailed] = useState(false)

    if (logoUri && !logoFailed) {
        return (
            <div className="w-8 h-8 shrink-0 rounded bg-bg-light border flex items-center justify-center p-1">
                <img
                    src={logoUri}
                    alt={`${name} logo`}
                    className="w-full h-full object-contain"
                    onError={() => setLogoFailed(true)}
                />
            </div>
        )
    }
    return (
        <div className="w-8 h-8 shrink-0 rounded bg-border flex items-center justify-center text-sm font-bold text-muted">
            {name.charAt(0).toUpperCase()}
        </div>
    )
}