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.

1.6 KB
Raw Blame
import { IconInfo } from '@posthog/icons'
import { Tooltip } from '@posthog/lemon-ui'

import { RestrictionScope, useRestrictedArea } from 'lib/components/RestrictedArea'
import { TeamMembershipLevel } from 'lib/constants'
import { LinkedHogFunctions } from 'scenes/hog-functions/list/LinkedHogFunctions'
import { urls } from 'scenes/urls'

export function DiscussionMentionNotifications(): JSX.Element | null {
    const restrictedReason = useRestrictedArea({
        scope: RestrictionScope.Project,
        minimumAccessLevel: TeamMembershipLevel.Admin,
    })

    if (restrictedReason) {
        return null
    }

    return (
        <div>
            <p className="flex items-center gap-1">
                Get notified when someone mentions you in a discussion.
                <Tooltip
                    title={
                        <>
                            Configure destination integrations (e.g., Slack, Discord, Microsoft Teams) to receive
                            notifications when you are mentioned in discussions on replays, notebooks, insights, and
                            other items.
                        </>
                    }
                >
                    <IconInfo className="text-lg" />
                </Tooltip>
            </p>

            <LinkedHogFunctions
                type="internal_destination"
                subTemplateIds={['discussion-mention']}
                emptyText="No notifications configured"
                queryParams={{
                    returnTo: urls.settings('environment-discussions', 'discussion-mention-integrations'),
                }}
            />
        </div>
    )
}