/** * ========================================================================= * PLATEFORME ECO-PANNEAU.FR - VERSION 1.0.0 * Socle Éditeur (3/4) - Onglet Affichage et Personnalisation * ========================================================================= */ window.pano_PanneauEditorAffichage = ({ panneau, setPanneau, uiMode, settings }) => { // 1. RÉCUPÉRATION DES COMPOSANTS ET ICÔNES GLOBAUX const Toggle = window.pano_Toggle || (() => null); const { EyeIcon, PaletteIcon, UploadCloudIcon, Trash2Icon } = window.pano_getIcons(); // 2. LOGIQUE D'AFFICHAGE (Mode simplifié vs pro) const isAdvanced = uiMode === 'professionnel'; const showTheme = isAdvanced || settings?.simp_opt_theme === '1'; const showHideInter = isAdvanced || settings?.simp_opt_hide_intervenants === '1'; const showHideLots = isAdvanced || settings?.simp_opt_hide_lots === '1'; const showHideLegal = isAdvanced || settings?.simp_opt_hide_legal === '1'; const showVisibility = showHideInter || showHideLots || showHideLegal; const displayOptions = panneau.displayOptions || { hideLots: false, hideIntervenants: false, hideLegal: false, customColor: '#059669', phone: '', hours: '', link: '' }; // 3. HANDLERS SPÉCIFIQUES const updateDisplayOption = (key, value) => { setPanneau({ ...panneau, displayOptions: { ...displayOptions, [key]: value } }); }; const handleFileUpload = async (e, type) => { const file = e.target.files[0]; if (!file) return; if (type === 'logo') { const reader = new FileReader(); reader.onload = async (event) => { const base64Url = event.target.result; setPanneau(prev => ({ ...prev, maitreOuvrageLogoUrl: base64Url })); try { const fileId = await window.pano_uploadFile(file, 'image', null, false, false, panneau.client_uid, panneau.id); setPanneau(prev => ({ ...prev, maitreOuvrageLogoId: fileId })); } catch (err) { if (window.pano_showToast) window.pano_showToast(err, "error"); setPanneau(prev => ({ ...prev, maitreOuvrageLogoUrl: '' })); } }; reader.readAsDataURL(file); } }; // 4. RENDU return (
{showVisibility && (

Visibilité riverains

Contrôlez les éléments qui s'affichent publiquement sur le scan QR du panneau.

{showHideInter && (
updateDisplayOption('hideIntervenants', !displayOptions.hideIntervenants)}> Masquer l'équipe (intervenants)
)} {showHideLots && (
updateDisplayOption('hideLots', !displayOptions.hideLots)}> Masquer les entreprises (lots)
)} {showHideLegal && (
updateDisplayOption('hideLegal', !displayOptions.hideLegal)}> Masquer l'arrêté légal et documents
)}
)}

Apparence du panneau public

{showTheme && (

Cliquez sur le carré de couleur ci-dessous pour ouvrir le sélecteur, ou saisissez un code Hexadécimal.

updateDisplayOption('customColor', e.target.value)} className="w-14 h-14 rounded-xl cursor-pointer border-4 border-slate-200 shadow-sm" title="Cliquez pour choisir une couleur" /> updateDisplayOption('customColor', e.target.value)} className="flex-1 border-2 border-slate-200 rounded-xl p-3 focus:border-emerald-500 outline-none transition font-bold font-mono uppercase" placeholder="#059669" />
)}
{(panneau.maitreOuvrageLogoUrl || panneau.maitreOuvrageLogoId) && (
Logo Propriétaire
{ e.preventDefault(); if (panneau.maitreOuvrageLogoId) { window.pano_apiFetch('file/delete', { body: { id: panneau.maitreOuvrageLogoId } }); } setPanneau({...panneau, maitreOuvrageLogoUrl: '', maitreOuvrageLogoId: ''}); }} className="absolute top-1 right-1 bg-red-600/90 hover:bg-red-600 text-white p-1.5 rounded-full opacity-0 group-hover:opacity-100 transition-all cursor-pointer shadow-md" title="Supprimer le logo" >
)}
); }; /* EOF ========== [_react/_socle_editeur_affichage.jsx] */