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

131 lines
4.6 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 DisplaySettingsProps {
preferences: UserPreferences;
onChange: (updater: (prev: UserPreferences) => UserPreferences) => void;
}
export default function DisplaySettings({ preferences, onChange }: DisplaySettingsProps) {
return (
<div>
<h3 style={{ fontSize: '18px', fontWeight: 'bold', marginBottom: '24px' }}>
Настройки отображения
</h3>
<div style={{ display: 'flex', flexDirection: 'column', gap: '24px' }}>
<div>
<label style={{ display: 'block', marginBottom: '8px', fontSize: '14px', fontWeight: '500' }}>
Записей на странице
</label>
<select
value={preferences.pagination.itemsPerPage}
onChange={(e) =>
onChange((prev) => ({
...prev,
pagination: {
...prev.pagination,
itemsPerPage: parseInt(e.target.value, 10) || 20,
},
}))
}
style={{
width: '100%',
padding: '8px',
border: '1px solid #ccc',
borderRadius: '4px',
fontSize: '14px',
}}
>
<option value="20">20</option>
<option value="50">50</option>
<option value="100">100</option>
<option value="200">200</option>
</select>
</div>
<label style={{ display: 'flex', alignItems: 'center', gap: '12px', cursor: 'pointer' }}>
<input
type="checkbox"
checked={preferences.pagination.showTotal}
onChange={(e) =>
onChange((prev) => ({
...prev,
pagination: { ...prev.pagination, showTotal: e.target.checked },
}))
}
style={{ width: '18px', height: '18px' }}
/>
<div>
<div style={{ fontSize: '14px', fontWeight: '500' }}>Показывать общее количество</div>
<div style={{ fontSize: '12px', color: '#666' }}>
Отображать общее количество записей в списках
</div>
</div>
</label>
<label style={{ display: 'flex', alignItems: 'center', gap: '12px', cursor: 'pointer' }}>
<input
type="checkbox"
checked={preferences.display.compactMode}
onChange={(e) =>
onChange((prev) => ({
...prev,
display: { ...prev.display, compactMode: e.target.checked },
}))
}
style={{ width: '18px', height: '18px' }}
/>
<div>
<div style={{ fontSize: '14px', fontWeight: '500' }}>Компактный режим</div>
<div style={{ fontSize: '12px', color: '#666' }}>
Уменьшить отступы и размеры элементов
</div>
</div>
</label>
<label style={{ display: 'flex', alignItems: 'center', gap: '12px', cursor: 'pointer' }}>
<input
type="checkbox"
checked={preferences.display.showTooltips}
onChange={(e) =>
onChange((prev) => ({
...prev,
display: { ...prev.display, showTooltips: e.target.checked },
}))
}
style={{ width: '18px', height: '18px' }}
/>
<div>
<div style={{ fontSize: '14px', fontWeight: '500' }}>Показывать подсказки</div>
<div style={{ fontSize: '12px', color: '#666' }}>
Отображать всплывающие подсказки при наведении
</div>
</div>
</label>
<label style={{ display: 'flex', alignItems: 'center', gap: '12px', cursor: 'pointer' }}>
<input
type="checkbox"
checked={preferences.display.animations}
onChange={(e) =>
onChange((prev) => ({
...prev,
display: { ...prev.display, animations: e.target.checked },
}))
}
style={{ width: '18px', height: '18px' }}
/>
<div>
<div style={{ fontSize: '14px', fontWeight: '500' }}>Анимации</div>
<div style={{ fontSize: '12px', color: '#666' }}>
Включить анимации переходов и эффекты
</div>
</div>
</label>
</div>
</div>
);
}