Correction de l'affichage en tant que mono détenteur
This commit is contained in:
@@ -424,6 +424,9 @@ export default function Plateformes() {
|
||||
];
|
||||
}, [platRows, investisseurs]);
|
||||
|
||||
/* ── Vrai/faux multi-détenteur global (indépendant de la plateforme sélectionnée) ── */
|
||||
const multiDetenteur = new Set(plats.map(p => p.investisseur_id)).size > 1;
|
||||
|
||||
/* ── Reset détenteur quand plateforme change (skip restauration initiale) ── */
|
||||
const isFirstPlatChange = useRef(true);
|
||||
useEffect(() => {
|
||||
@@ -1534,7 +1537,7 @@ export default function Plateformes() {
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Projet</th>
|
||||
<th>Détenteur</th>
|
||||
{multiDetenteur && <th>Détenteur</th>}
|
||||
<th className="num">Date de souscription</th>
|
||||
<th className="num">Date cible</th>
|
||||
<th className="num">Montant</th>
|
||||
@@ -1555,7 +1558,7 @@ export default function Plateformes() {
|
||||
<tr key={r.id} style={{ cursor: 'pointer' }}
|
||||
onClick={() => navigate(`/investissements/${r.id}`, { state: { from: { path: location.pathname, search: location.search, label: 'Plateformes' } } })}>
|
||||
<td style={{ fontWeight: 500 }}>{r.nom_projet}</td>
|
||||
<td className="text-muted" style={{ fontSize: 'var(--fs-sm)' }}>{(() => { const inv = investisseurs.find(i => i.id === r.investisseur_id); return inv ? memberLabel(inv) : '—'; })()}</td>
|
||||
{multiDetenteur && <td className="text-muted" style={{ fontSize: 'var(--fs-sm)' }}>{(() => { const inv = investisseurs.find(i => i.id === r.investisseur_id); return inv ? memberLabel(inv) : '—'; })()}</td>}
|
||||
<td className="num" style={{ fontSize: 'var(--fs-sm)', color: 'var(--text-muted)' }}>{fmtDate(r.date_souscription)}</td>
|
||||
<td className="num" style={{ fontSize: 'var(--fs-sm)', color: 'var(--text-muted)' }}>{fmtDate(r.date_cible)}</td>
|
||||
<td className="num">{fmtEUR(r.montant_investi)}</td>
|
||||
|
||||
Reference in New Issue
Block a user