klg-asutk-app/app/modifications/page.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

29 lines
1.3 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 { useState, useEffect } from 'react';
import { PageLayout, DataTable, StatusBadge, EmptyState } from '@/components/ui';
export default function ModificationsPage() {
const [mods, setMods] = useState([] as any[]);
const [loading, setLoading] = useState(true);
useEffect(() => {
setLoading(true); fetch('/api/v1/modifications').then(r => r.json()).then(d => { setMods(d.items || []); setLoading(false); }); }, []);
return (
<>
{loading && <div className="fixed inset-0 bg-white/50 z-50 flex items-center justify-center"><div className="text-gray-500"> Загрузка...</div></div>}
<PageLayout title="⚙️ Модификации ВС" subtitle="ФАП-21; EASA Part-21.A.97; ICAO Annex 8">
{mods.length > 0 ? (
<DataTable columns={[
{ key: 'number', label: '№' },
{ key: 'title', label: 'Наименование' },
{ key: 'aircraft_reg', label: 'Борт' },
{ key: 'mod_type', label: 'Тип' },
{ key: 'status', label: 'Статус', render: (v: string) => (
<StatusBadge status={v} colorMap={{ pending: 'bg-yellow-500', approved: 'bg-green-500', incorporated: 'bg-blue-500', rejected: 'bg-red-500' }} />
)},
]} data={mods} />
) : <EmptyState message="Нет модификаций" />}
</PageLayout>
</>
);
}