/** * ========================================================================= * PLATEFORME ECO-PANNEAU.FR - VERSION 1.0.0 * Composant : Modale d'aperçu interactif (Mobile et A1) * ========================================================================= */ const { useState } = React; window.PreviewModal = ({ panneau, interactions = [], onClose, showToast, refreshData, isAdmin = false, onValidate, onContactClient, onSuspend }) => { const [previewMode, setPreviewMode] = useState('mobile'); const [showAdminMenu, setShowAdminMenu] = useState(false); const XIcon = window.XIcon || (() => null); const CheckCircleIcon = window.CheckCircleIcon || (() => null); const MessageSquareIcon = window.MessageSquareIcon || (() => null); const PowerIcon = window.PowerIcon || (() => null); const Button = window.Button || (() => null); const ModalOverlay = window.ModalOverlay || (({ children }) =>
{children}
); return (
e.stopPropagation()} >
setPreviewMode('mobile')} className={`px-4 py-2 sm:py-2.5 rounded-xl text-xs sm:text-sm font-bold transition-all duration-200 cursor-pointer ${previewMode === 'mobile' ? 'bg-white text-slate-900 shadow-sm' : 'text-slate-400 hover:text-white hover:bg-white/10'}`} > Mode Smartphone
setPreviewMode('a1')} className={`px-4 py-2 sm:py-2.5 rounded-xl text-xs sm:text-sm font-bold transition-all duration-200 cursor-pointer ${previewMode === 'a1' ? 'bg-white text-slate-900 shadow-sm' : 'text-slate-400 hover:text-white hover:bg-white/10'}`} > Panneau Physique (A1)
e.stopPropagation()} className="pointer-events-auto bg-white/10 hover:bg-white/20 text-white rounded-full p-3 transition backdrop-blur-md border border-white/10 shadow-2xl shrink-0 cursor-pointer">
{ if (e.target === e.currentTarget) { onClose(); } }} > {previewMode === 'mobile' ? (
e.stopPropagation()}>
{/* ENCOCHE DU SMARTPHONE (STATIQUE) */}
{ e.stopPropagation(); if (isAdmin && panneau.status === 'Actif') setShowAdminMenu(true); }} >
{isAdmin && previewMode === 'mobile' && panneau.status === 'Actif' && (
Admin
)}
{/* MODALE DE MODÉRATION INTERNE AU TÉLÉPHONE */} {showAdminMenu && (
{ e.stopPropagation(); setShowAdminMenu(false); }}>
e.stopPropagation()}>
Actions modérateur
setShowAdminMenu(false)} className="text-slate-400 hover:text-slate-600 cursor-pointer bg-slate-100 hover:bg-slate-200 transition rounded-full p-1.5 shrink-0">
{!panneau.admin_seen && ( )}
)} {window.RiverainView ? ( ) : (
Le module d'aperçu n'a pas pu être chargé.
)}
) : (
e.stopPropagation()}> {window.PrintA1View ? ( ) : (
Le module de rendu A1 n'a pas pu être chargé.
)}
)}
); }; /* EOF ========== [_react/_clients_modals_preview.jsx] */