klg-asutk-app/components/settings/DisplaySettings.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

24 lines
982 B
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 { useDarkMode } from '@/hooks/useDarkMode';
export default function DisplaySettings() {
const { theme, setTheme, isDark } = useDarkMode();
return (
<div className="space-y-4">
<h3 className="text-lg font-bold">Отображение</h3>
<div className="space-y-2">
{(['light', 'dark', 'system'] as const).map(t => (
<label key={t} className="flex items-center gap-3 cursor-pointer p-3 rounded-lg hover:bg-gray-50">
<input type="radio" name="theme" checked={theme === t} onChange={() => setTheme(t)} className="w-4 h-4" />
<span className="text-sm font-medium">{t === 'light' ? '☀️ Светлая' : t === 'dark' ? '🌙 Тёмная' : '💻 Системная'}</span>
</label>
))}
</div>
<div className="p-4 bg-gray-50 rounded text-sm text-gray-500">
Текущая тема: {isDark ? 'Тёмная' : 'Светлая'}
</div>
</div>
);
}