import { PropsWithChildren } from 'react'; import { BROWSER_OS_PLATFORM } from '@/react/constants'; import { CodeEditor } from '@@/CodeEditor'; import { Tooltip } from '@@/Tip/Tooltip'; import { FormSectionTitle } from './form-components/FormSectionTitle'; const otherEditorConfig = { tooltip: ( <>
Ctrl+F - Start searching
Ctrl+G - Find next
Ctrl+Shift+G - Find previous
Ctrl+Shift+F - Replace
Ctrl+Shift+R - Replace all
Alt+G - Jump to line
Persistent search:
Enter - Find next
Shift+Enter - Find previous
), searchCmdLabel: 'Ctrl+F for search', } as const; const editorConfig = { mac: { tooltip: ( <>
Cmd+F - Start searching
Cmd+G - Find next
Cmd+Shift+G - Find previous
Cmd+Option+F - Replace
Cmd+Option+R - Replace all
Option+G - Jump to line
Persistent search:
Enter - Find next
Shift+Enter - Find previous
), searchCmdLabel: 'Cmd+F for search', }, lin: otherEditorConfig, win: otherEditorConfig, } as const; interface Props { value: string; onChange: (value: string) => void; id: string; placeholder?: string; yaml?: boolean; readonly?: boolean; hideTitle?: boolean; error?: string; } export function WebEditorForm({ id, onChange, placeholder, value, hideTitle, readonly, yaml, children, error, }: PropsWithChildren) { return (
{!hideTitle && ( Web editor
{editorConfig[BROWSER_OS_PLATFORM].searchCmdLabel}
)} {children && (
{children}
)}
{error}
); }