klg-asutk-app/components/settings/NotificationSettings.tsx
Yuriy 0150aba4f5 Consolidation: KLG ASUTK + PAPA integration
- Unify API: lib/api.ts uses /api/v1, inbox uses /api/inbox (rewrites)
- Remove localhost refs: openapi, inbox page
- Add rewrites: /api/inbox|tmc -> inbox-server, /api/v1 -> FastAPI
- Add stub routes: knowledge/insights, recommendations, search, log-error
- Transfer from PAPA: prompts (inspection, tmc), scripts, supabase, data/tmc-requests
- Fix inbox-server: ORDER BY created_at, package.json
- Remove redundant app/api/inbox/files route (rewrites handle it)
- knowledge/ in gitignore (large PDFs)

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-08 17:18:31 +03:00

48 lines
2.0 KiB
TypeScript
Raw 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 type { UserPreferences } from './types';
interface NotificationSettingsProps {
preferences: UserPreferences;
onChange: (updater: (prev: UserPreferences) => UserPreferences) => void;
}
export default function NotificationSettings({ preferences, onChange }: NotificationSettingsProps) {
const items: { key: keyof UserPreferences['notifications']; title: string; desc: string }[] = [
{ key: 'email', title: 'Email уведомления', desc: 'Получать уведомления на электронную почту' },
{ key: 'push', title: 'Push уведомления', desc: 'Получать push-уведомления в браузере' },
{ key: 'sound', title: 'Звуковые сигналы', desc: 'Воспроизводить звук для критических уведомлений' },
{ key: 'criticalOnly', title: 'Только критические', desc: 'Показывать только критические уведомления' },
];
return (
<div>
<h3 style={{ fontSize: '18px', fontWeight: 'bold', marginBottom: '24px' }}>
Настройки уведомлений
</h3>
<div style={{ display: 'flex', flexDirection: 'column', gap: '20px' }}>
{items.map(({ key, title, desc }) => (
<label key={key} style={{ display: 'flex', alignItems: 'center', gap: '12px', cursor: 'pointer' }}>
<input
type="checkbox"
checked={preferences.notifications[key]}
onChange={(e) =>
onChange((prev) => ({
...prev,
notifications: { ...prev.notifications, [key]: e.target.checked },
}))
}
style={{ width: '18px', height: '18px' }}
/>
<div>
<div style={{ fontSize: '14px', fontWeight: '500' }}>{title}</div>
<div style={{ fontSize: '12px', color: '#666' }}>{desc}</div>
</div>
</label>
))}
</div>
</div>
);
}