Update tooltip text for search buttons (#23448)
GitOrigin-RevId: d189aac06c5f68e009eeb125d7cc225b41e8cc0c
This commit is contained in:
+22
@@ -0,0 +1,22 @@
|
||||
import { FC } from 'react'
|
||||
import * as commands from '@/features/source-editor/extensions/toolbar/commands'
|
||||
import { searchPanelOpen } from '@codemirror/search'
|
||||
import { ToolbarButton } from '@/features/source-editor/components/toolbar/toolbar-button'
|
||||
import { EditorState } from '@codemirror/state'
|
||||
import { useTranslation } from 'react-i18next'
|
||||
import { isMac } from '@/shared/utils/os'
|
||||
|
||||
export const ToggleSearchButton: FC<{ state: EditorState }> = ({ state }) => {
|
||||
const { t } = useTranslation()
|
||||
|
||||
return (
|
||||
<ToolbarButton
|
||||
id="toolbar-toggle-search"
|
||||
label={t('search_this_file')}
|
||||
command={commands.toggleSearch}
|
||||
active={searchPanelOpen(state)}
|
||||
icon="search"
|
||||
shortcut={isMac ? '⌘F' : 'Ctrl+F'}
|
||||
/>
|
||||
)
|
||||
}
|
||||
Reference in New Issue
Block a user