import React, { useEffect } from 'react'; import { CatalogModuleItem, READINESS_CONFIG, AVAILABILITY_CONFIG } from './catalogData'; import { Button } from '../../shared/ui/Button'; import { Badge } from '../../shared/ui/Badge'; import { MaturityBadge } from '../../shared/ui/MaturityBadge'; import { X, ArrowRight, CheckCircle2, Layers, Link2, ShieldCheck, Target, } from 'lucide-react'; import { useNavigate } from 'react-router-dom'; export interface ModuleInfoModalProps { module: CatalogModuleItem | null; isOpen: boolean; onClose: () => void; } export const ModuleInfoModal: React.FC = ({ module, isOpen, onClose }) => { const navigate = useNavigate(); // Escape key handler useEffect(() => { if (!isOpen) return; const handleKeyDown = (e: KeyboardEvent) => { if (e.key === 'Escape') onClose(); }; window.addEventListener('keydown', handleKeyDown); return () => window.removeEventListener('keydown', handleKeyDown); }, [isOpen, onClose]); if (!isOpen || !module) return null; const readinessInfo = READINESS_CONFIG[module.readiness]; const availabilityInfo = AVAILABILITY_CONFIG[module.availability]; const handleOpenModule = () => { onClose(); navigate(module.route); }; return (
{/* Backdrop */}
{/* Modal Card */}
{/* Header */}
Информация о модуле {availabilityInfo.label}

{module.title}

{module.description}

{/* Section 1: Purpose */}
1. Назначение модуля
{module.details.purpose}
{/* Section 2: Expected Capabilities */}
2. Ключевые функциональные возможности
{module.details.expectedCapabilities.map((cap, idx) => (
{cap}
))}
{/* Section 3: Current Status */}
3. Статус реализации
{readinessInfo.label}: {module.details.currentStatus}
{/* Section 4: Planned Integrations */}
4. Запланированные интеграции
{module.details.plannedIntegrations.map((integ, idx) => ( {integ} ))}
{/* Footer Actions */}
Маршрут в системе: {module.route}
); };