- 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>
88 lines
3.1 KiB
TypeScript
88 lines
3.1 KiB
TypeScript
'use client';
|
||
|
||
import type { UserPreferences } from './types';
|
||
|
||
interface ExportSettingsProps {
|
||
preferences: UserPreferences;
|
||
onChange: (updater: (prev: UserPreferences) => UserPreferences) => void;
|
||
}
|
||
|
||
export default function ExportSettings({ preferences, onChange }: ExportSettingsProps) {
|
||
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.export.defaultFormat}
|
||
onChange={(e) =>
|
||
onChange((prev) => ({
|
||
...prev,
|
||
export: { ...prev.export, defaultFormat: e.target.value as UserPreferences['export']['defaultFormat'] },
|
||
}))
|
||
}
|
||
style={{
|
||
width: '100%',
|
||
padding: '8px',
|
||
border: '1px solid #ccc',
|
||
borderRadius: '4px',
|
||
fontSize: '14px',
|
||
}}
|
||
>
|
||
<option value="excel">Excel (.xlsx)</option>
|
||
<option value="csv">CSV</option>
|
||
<option value="pdf">PDF</option>
|
||
<option value="json">JSON</option>
|
||
</select>
|
||
</div>
|
||
|
||
<label style={{ display: 'flex', alignItems: 'center', gap: '12px', cursor: 'pointer' }}>
|
||
<input
|
||
type="checkbox"
|
||
checked={preferences.export.includeHeaders}
|
||
onChange={(e) =>
|
||
onChange((prev) => ({
|
||
...prev,
|
||
export: { ...prev.export, includeHeaders: 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.export.autoExport}
|
||
onChange={(e) =>
|
||
onChange((prev) => ({
|
||
...prev,
|
||
export: { ...prev.export, autoExport: 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>
|
||
);
|
||
}
|