'use client'; import React, { useState, useEffect, useRef } from 'react'; import { Toast } from 'primereact/toast'; interface ConnectionStatusProps { showToasts?: boolean; showIndicator?: boolean; className?: string; } export const ConnectionStatusSimple: React.FC = ({ showToasts = true, showIndicator = true, className = '' }) => { const [isOnline, setIsOnline] = useState(true); const toast = useRef(null); useEffect(() => { console.log('ConnectionStatusSimple mounted - no API calls for now'); // Pas d'API call pour le moment, juste pour tester le composant setIsOnline(true); }, []); if (!showIndicator && showToasts) { return ; } if (!showIndicator) { return null; } return (
{isOnline ? 'Serveur OK' : 'Serveur KO'}
); }; export default ConnectionStatusSimple;