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.

992 B
Raw Blame
import { useActions } from 'kea'

import { IconPlusSmall } from '@posthog/icons'
import { LemonButton, LemonButtonPropsBase } from '@posthog/lemon-ui'

import { inviteLogic } from 'lib/logic/inviteLogic'
import { eventUsageLogic } from 'lib/utils/eventUsageLogic'

export function InviteMembersButton({
    text = 'Invite members',
    center = false,
    type = 'tertiary',
    ...props
}: LemonButtonPropsBase & { text?: string }): JSX.Element {
    const { showInviteModal } = useActions(inviteLogic)
    const { reportInviteMembersButtonClicked } = useActions(eventUsageLogic)

    return (
        <LemonButton
            icon={<IconPlusSmall />}
            onClick={() => {
                showInviteModal()
                reportInviteMembersButtonClicked()
            }}
            center={center}
            type={type}
            fullWidth
            data-attr="top-menu-invite-team-members"
            {...props}
        >
            {text}
        </LemonButton>
    )
}