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.1 KB
Raw Blame
import { useActions, useValues } from 'kea'

import { IconChat } from '@posthog/icons'
import { Button } from '@posthog/quill'

import { sidePanelDiscussionLogic } from '~/layout/navigation-3000/sidepanel/panels/discussion/sidePanelDiscussionLogic'

import { NOTES_BUTTON_TOOLTIP } from './ObservationNotesButton'
import { notesButtonLabel, replayObservationSceneLogic } from './replayObservationSceneLogic'

export function QuillObservationNotesButton(): JSX.Element {
    const { notesPanelOpen, notesDisabledReason } = useValues(replayObservationSceneLogic)
    const { commentCount } = useValues(sidePanelDiscussionLogic)
    const { toggleNotesPanel } = useActions(replayObservationSceneLogic)
    return (
        <Button
            variant="outline"
            aria-pressed={notesPanelOpen}
            onClick={toggleNotesPanel}
            disabledReason={notesDisabledReason ?? undefined}
            tooltip={NOTES_BUTTON_TOOLTIP}
            data-attr="vision-observation-notes"
        >
            <IconChat />
            {notesButtonLabel(notesDisabledReason, commentCount)}
        </Button>
    )
}