// Fichier : src/pages/InfrastructureEvolution.tsx import React, { useState, useEffect } from 'react'; import { useNavigate } from 'react-router-dom'; import { useEvolutionRequest } from '@/hooks/useEvolutionRequest'; import { BackButton } from '@/components/ui/BackButton'; import { EmptyState } from '@/components/ui/EmptyState'; // Nos nouveaux composants import { EvolutionOptionCard } from '@/components/widgets/EvolutionOptionCard'; import { EvolutionFilterBar } from '@/components/widgets/EvolutionFilterBar'; import { EVOLUTION_OPTIONS, type EvolutionOption } from '@/data/evolutionOptions'; import SupportFooterWidget from '@/components/widgets/SupportFooterWidget'; export const InfrastructureEvolution: React.FC = () => { const navigate = useNavigate(); const { submitRequest, isSubmitting, submitSuccess, error } = useEvolutionRequest(); const [selectedCategory, setSelectedCategory] = useState('all'); const [searchQuery, setSearchQuery] = useState(''); const [selectedOptionId, setSelectedOptionId] = useState(null); // Redirection automatique useEffect(() => { if (submitSuccess) { const timer = setTimeout(() => navigate('/dashboard'), 3000); return () => clearTimeout(timer); } }, [submitSuccess, navigate]); // Logique de filtrage const filteredOptions = EVOLUTION_OPTIONS.filter((opt) => { const matchesCategory = selectedCategory === 'all' || opt.category === selectedCategory; const matchesSearch = opt.title.toLowerCase().includes(searchQuery.toLowerCase()) || opt.description.toLowerCase().includes(searchQuery.toLowerCase()); return matchesCategory && matchesSearch; }); const handleSelectOption = (option: EvolutionOption) => { setSelectedOptionId(option.id); submitRequest(option.subject, option.payloadDescription); }; return (
{/* EN-TÊTE DE LA PAGE */}
AEGIS • Catalogue Projets

Évolution & Extension de l'Infrastructure

Sélectionnez une initiative stratégique. Votre demande ouvrira immédiatement un ticket projet sécurisé auprès de votre référent technique GISE.

{/* ÉTAT DE SUCCÈS */} {submitSuccess ? (

Demande d'évolution enregistrée

Votre ticket projet a été chiffré et transmis à notre équipe d'ingénierie. Un expert GISE analyse vos prérequis et reprendra contact avec vous sous 24h ouvrées.

Redirection automatique vers le Trust Center...

) : ( <> {/* BARRE DE RECHERCHE ET FILTRES */} {/* AFFICHAGE DES ERREURS */} {error && (
{error}
)} {/* GRILLE DES OPTIONS */} {filteredOptions.length === 0 ? (
) : (
{filteredOptions.map((option) => ( ))}
)} {/* PIED DE PAGE D'ASSISTANCE */} )}
); }; export default InfrastructureEvolution;