/** * ========================================================================= * PLATEFORME ECO-PANNEAU.FR - VERSION 1.0.0 * Socle Éditeur (2/4) - Onglets Intervenants et Lots (Acteurs) * ========================================================================= */ // ========================================================================= // 1. COMPOSANT : INTERVENANTS PRINCIPAUX // ========================================================================= window.pano_PanneauEditorIntervenants = ({ panneau, lockedFields = [], onEditEntity, deleteEntity, handleDragStart, handleDragOver, handleDrop }) => { const isFieldLocked = (field) => lockedFields.includes(field); const { PlusIcon, BuildingIcon, EditIcon, Trash2Icon, LockIcon } = window.pano_getIcons(); const Button = window.pano_Button || (() => null); const EmptyState = window.pano_EmptyState || (() => null); return (

Déclarez l'architecte, le bureau de contrôle, etc. {isFieldLocked('intervenants') && }

{!isFieldLocked('intervenants') && ( )}
{(!panneau.intervenants || panneau.intervenants.length === 0) && ( )} {(panneau.intervenants || []).map((inter, i) => (
handleDragStart(e, { type: 'intervenant', index: i }) : undefined} onDragOver={handleDragOver ? handleDragOver : undefined} onDrop={handleDrop ? (e) => handleDrop(e, { type: 'intervenant', index: i }) : undefined} className={`bg-white border border-slate-200 p-4 rounded-2xl flex justify-between items-center shadow-sm transition group ${!isFieldLocked('intervenants') && handleDragStart ? 'cursor-move hover:border-emerald-300' : ''}`} >
{!isFieldLocked('intervenants') && handleDragStart && (
::
)} {(inter.logoUrl || inter.logoId) && ( Logo )}

{inter.name}

{inter.role}

{!isFieldLocked('intervenants') && (
{onEditEntity && (
)}
))}
); }; // ========================================================================= // 2. COMPOSANT : LOTS ET ENTREPRISES SOUS-TRAITANTES // ========================================================================= window.pano_PanneauEditorLots = ({ panneau, lockedFields = [], onEditEntity, deleteEntity, handleDragStart, handleDragOver, handleDrop }) => { const isFieldLocked = (field) => lockedFields.includes(field); const { PlusIcon, BuildingIcon, EditIcon, Trash2Icon, LockIcon } = window.pano_getIcons(); const Button = window.pano_Button || (() => null); const EmptyState = window.pano_EmptyState || (() => null); return (

Organisez les entreprises par lot de travaux. {isFieldLocked('lots') && }

{!isFieldLocked('lots') && ( )}
{(!panneau.lots || panneau.lots.length === 0) && ( )} {(panneau.lots || []).map((lot, lIdx) => (
handleDragStart(e, { type: 'lot', index: lIdx }) : undefined} onDragOver={handleDragOver ? handleDragOver : undefined} onDrop={handleDrop ? (e) => handleDrop(e, { type: 'lot', index: lIdx }) : undefined} className={`bg-slate-50 border border-slate-200 rounded-3xl p-5 ${!isFieldLocked('lots') && handleDragStart ? 'cursor-move' : ''}`} >
{!isFieldLocked('lots') && handleDragStart && ::}

{lot.name}

{!isFieldLocked('lots') && (
{onEditEntity &&
)}
{(lot.entreprises || []).map((ent, eIdx) => (
{ e.stopPropagation(); if(!isFieldLocked('lots') && handleDragStart) handleDragStart(e, { type: 'entreprise', lotIndex: lIdx, index: eIdx }); }} onDragOver={(e) => { if(handleDragOver) handleDragOver(e); else e.preventDefault(); }} onDrop={(e) => { e.stopPropagation(); if(handleDrop) handleDrop(e, { type: 'entreprise', lotIndex: lIdx, index: eIdx }); }} className={`bg-white border border-slate-200 p-3 rounded-2xl flex justify-between items-center shadow-sm transition ${!isFieldLocked('lots') && handleDragStart ? 'cursor-move hover:border-emerald-300' : ''}`} >
{!isFieldLocked('lots') && handleDragStart && ::} {(ent.logoUrl || ent.logoId) && ( Logo )}

{ent.name}

{!isFieldLocked('lots') && (
{onEditEntity &&
)}
))} {onEditEntity && !isFieldLocked('lots') && ( )}
))}
); }; /* EOF ========== [_react/_socle_editeur_acteurs.jsx] */