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.

2.0 KB
Raw Blame
import { useValues } from 'kea'

import { LemonCollapse } from '@posthog/lemon-ui'

import { AdminLoginButtons } from '~/layout/navigation/ImpersonationNotice/AdminLoginButtons'
import { impersonationNoticeLogic } from '~/layout/navigation/ImpersonationNotice/impersonationNoticeLogic'

export function StaffActionsPanel(): JSX.Element {
    const { ticketContext, adminLoginUrls } = useValues(impersonationNoticeLogic)

    return (
        <LemonCollapse
            className="bg-surface-primary"
            defaultActiveKey="staff-actions"
            panels={[
                {
                    key: 'staff-actions',
                    header: 'Staff actions',
                    content: (
                        <div className="space-y-2">
                            <div className="flex flex-col gap-2">
                                <span className="text-xs text-muted-alt break-all">
                                    {ticketContext?.email ? (
                                        <>
                                            Customer:{' '}
                                            <span
                                                className={ticketContext.isEmailUnverified ? undefined : 'text-success'}
                                            >
                                                {ticketContext.email}
                                            </span>
                                            {ticketContext.isEmailUnverified && ' (not verified)'}
                                        </>
                                    ) : (
                                        'No customer email on this ticket'
                                    )}
                                </span>
                                <AdminLoginButtons ticketContext={ticketContext} adminLoginUrls={adminLoginUrls} />
                            </div>
                        </div>
                    ),
                },
            ]}
        />
    )
}