klg-asutk-app/components/OrganizationDetailsModal.tsx
Yuriy 891e17972c fix(klg): безопасность, deps/security, attachments, CSP, api-client, удаление lib/api.ts
- deps: авторизация через app.services.security (JWT/OIDC), без oidc fallback
- main: AUTH_DEPENDENCY для роутеров, RequestLoggerMiddleware, убран on_event(startup)
- attachments: защита path traversal, проверка владельца/authority
- docker-compose: SECRET_KEY обязателен, отдельная БД keycloak-db
- middleware: ужесточён CSP (без unsafe-eval в prod, без api.openai.com)
- api-client: токен только в памяти, без sessionStorage
- cert_applications: _next_number с SELECT FOR UPDATE
- Удалён lib/api.ts, импорты на @/lib/api/api-client
- docs ERROR_HANDLING: aircraftApi.list(), middleware __init__.py

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-02-14 23:06:22 +03:00

23 lines
1.2 KiB
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 { Modal, DataTable, StatusBadge } from '@/components/ui';
import { Aircraft } from '@/lib/api/api-client';
interface Props { isOpen: boolean; onClose: () => void; organization: string; aircraft: Aircraft[]; onEdit?: (a: Aircraft) => void; }
export default function OrganizationDetailsModal({ isOpen, onClose, organization, aircraft, onEdit }: Props) {
return (
<Modal isOpen={isOpen} onClose={onClose} title={organization} size="lg">
<div className="mb-4">
<div className="text-sm text-gray-500 mb-2">Воздушные суда: {aircraft.length}</div>
</div>
<DataTable data={aircraft} emptyMessage="Нет ВС" onRowClick={onEdit}
columns={[
{ key: 'registrationNumber', header: 'Регистрация', render: (a) => <span className="font-medium text-primary-500">{a.registrationNumber}</span> },
{ key: 'aircraftType', header: 'Тип' },
{ key: 'flightHours', header: 'Налёт (ч)', render: (a) => <span className="font-mono">{a.flightHours?.toLocaleString() || '—'}</span> },
{ key: 'status', header: 'Статус', render: (a) => <StatusBadge status={a.status} /> },
]} />
</Modal>
);
}