klg-asutk-app/components/KeyboardShortcutsHelp.tsx
Yuriy aa052763f6 Безопасность и качество: 8 исправлений + обновления
- .env.example: полный шаблон, защита секретов
- .gitignore: явное исключение .env.* и секретов
- layout.tsx: XSS — заменён dangerouslySetInnerHTML на next/script для SW
- ESLint: no-console error (allow warn/error), ignore scripts/
- scripts/remove-console-logs.js: очистка console.log без glob
- backend/routes/modules: README с планом рефакторинга крупных файлов
- SECURITY.md: гид по секретам, XSS, CORS, auth, линту
- .husky/pre-commit: запуск npm run lint

+ прочие правки приложения и бэкенда

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-14 21:29:16 +03:00

32 lines
1.4 KiB
TypeScript
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

'use client';
import { Modal } from '@/components/ui';
interface Props { isOpen: boolean; onClose: () => void; }
const shortcuts = [
{ keys: '⌘/Ctrl + K', action: 'Глобальный поиск' },
{ keys: '⌘/Ctrl + N', action: 'Создать новый объект' },
{ keys: '⌘/Ctrl + ,', action: 'Настройки' },
{ keys: '⌘/Ctrl + .', action: 'AI Ассистент' },
{ keys: 'Escape', action: 'Закрыть модальное окно' },
{ keys: '?', action: 'Показать горячие клавиши' },
{ keys: '←/→', action: 'Навигация по страницам' },
{ keys: '⌘/Ctrl + E', action: 'Экспорт данных' },
];
export default function KeyboardShortcutsHelp({ isOpen, onClose }: Props) {
return (
<Modal isOpen={isOpen} onClose={onClose} title="⌨️ Горячие клавиши" size="sm">
<div className="space-y-1">
{shortcuts.map(s => (
<div key={s.keys} className="flex justify-between items-center py-2 border-b border-gray-50">
<span className="text-sm">{s.action}</span>
<kbd className="bg-gray-100 text-gray-600 px-2 py-1 rounded text-xs font-mono">{s.keys}</kbd>
</div>
))}
</div>
<p className="text-xs text-gray-400 mt-4">Нажмите ? в любом месте для вызова этого окна</p>
</Modal>
);
}