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 { Kbd, cn } from '@posthog/quill'

import { todayShellLogic } from '~/layout/today/todayShellLogic'

import { commandKSearchLogic } from './commandKSearchLogic'

export function CommandKSearchFooter(): JSX.Element {
    const { highlightIsFilterRow, chips, chipSelection, tabAsksAi } = useValues(commandKSearchLogic)
    const { todayRailEnabled } = useValues(todayShellLogic)

    return (
        <div
            className={cn(
                todayRailEnabled && 'max-md:hidden',
                'flex flex-wrap items-center gap-x-3 gap-y-1 border-t border-border px-2 py-1.5 text-xxs text-muted-foreground select-none'
            )}
        >
            <span className="flex items-center gap-1">
                <Kbd>↑</Kbd>
                <Kbd>↓</Kbd> navigate
            </span>
            <span className="flex items-center gap-1">
                <Kbd>↵</Kbd> open
            </span>
            <span className="flex items-center gap-1">
                <Kbd>⌘↵</Kbd> new tab
            </span>
            {highlightIsFilterRow && (
                <span className="flex items-center gap-1">
                    <Kbd>⇥</Kbd> complete
                </span>
            )}
            {tabAsksAi && (
                <span className="flex items-center gap-1">
                    <Kbd>⇥</Kbd> ask AI
                </span>
            )}
            {chips.length > 0 && (
                <span className="flex items-center gap-1">
                    <Kbd>⌫</Kbd>{' '}
                    {chipSelection === 'all' ? 'clear all' : chipSelection === null ? 'select filter' : 'remove filter'}
                </span>
            )}
            {typeof chipSelection === 'number' && (
                <span className="flex items-center gap-1">
                    <Kbd>↵</Kbd> edit filter
                </span>
            )}
            <span className="flex items-center gap-1">
                <Kbd>Esc</Kbd> close
            </span>
        </div>
    )
}