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.

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

import { IconCopy, IconExternal } from '@posthog/icons'

import { todayChatMenuLogic } from './todayChatMenuLogic'
import { TodayMenuParts } from './todayMenuParts'

interface TodayChatActionItemsProps {
    parts: TodayMenuParts
    chatId: string
    dataAttrPrefix: string
}

export function TodayChatActionItems({
    parts: { Item },
    chatId,
    dataAttrPrefix,
}: TodayChatActionItemsProps): JSX.Element {
    const { openChatInNewTab, copyChatLink } = useActions(todayChatMenuLogic)
    const attr = (name: string): string => `${dataAttrPrefix}-${name}`

    return (
        <>
            <Item onClick={() => openChatInNewTab(chatId)} dataAttr={attr('open-new-tab')}>
                <IconExternal />
                Open in new tab
            </Item>
            <Item onClick={() => copyChatLink(chatId)} dataAttr={attr('copy-link')}>
                <IconCopy />
                Copy link
            </Item>
        </>
    )
}