/** * Menu d'actions pour les chantiers - Actions prioritaires BTP */ import React, { useRef } from 'react'; import { Button } from 'primereact/button'; import { Menu } from 'primereact/menu'; import { MenuItem } from 'primereact/menuitem'; import { ChantierActif } from '../../hooks/useDashboard'; interface ChantierMenuActionsProps { chantier: ChantierActif; onAction: (action: string, chantier: ChantierActif) => void; } const ChantierMenuActions: React.FC = ({ chantier, onAction }) => { const menuRef = useRef(null); // Actions prioritaires pour le workflow BTP const menuItems: MenuItem[] = [ { label: 'Gestion chantier', items: [ { label: 'Suspendre le chantier', icon: 'pi pi-pause', command: () => onAction('suspend', chantier) }, { label: 'Clôturer le chantier', icon: 'pi pi-check-circle', command: () => onAction('close', chantier) } ] }, { separator: true }, { label: 'Communication', items: [ { label: 'Notification client', icon: 'pi pi-send', command: () => onAction('notify-client', chantier) }, { label: 'Rapport de synthèse', icon: 'pi pi-file-pdf', command: () => onAction('generate-report', chantier) } ] }, { separator: true }, { label: 'Financier', items: [ { label: 'Facture intermédiaire', icon: 'pi pi-euro', command: () => onAction('generate-invoice', chantier) }, { label: 'Créer un avenant', icon: 'pi pi-file-plus', command: () => onAction('create-amendment', chantier) } ] } ]; const toggleMenu = (event: React.MouseEvent) => { menuRef.current?.toggle(event); }; return ( <>