This commit is contained in:
ocroguennec committed 2026-09-18 08:01:50 +02:00
1 parent 0df335803e
commit c2dbe506c5
3 files changed
+15 -4

No files matched your search

@@ -19,7 +19,14 @@ import { fmtEUR } from '../utils/format.js';
* onChange : (value) => void
* options : investissementOptions — { id, plateforme_nom, nom_projet, montant_investi }[]
*/
export default function InvestissementSelect({ value, onChange, options = [] }) {
export default function InvestissementSelect({
value, onChange, options = [],
// Libellé du sentinel INTERETS_PLATEFORME (17/09/26, cf. RemboursementsSimple.jsx —
// une distribution PE n'est pas un "intérêt" au sens crowdlending du terme ; la valeur
// technique INTERETS_PLATEFORME/interets_plateforme reste inchangée, seul l'intitulé
// affiché change). Par défaut, le libellé crowdlending d'origine.
interetsPlateformeLabel = '🏦 Intérêts plateforme',
}) {
const [open, setOpen] = useState(false);
const [dropPos, setDropPos] = useState({ left: 0, width: 0, maxHeight: 260, direction: 'down', top: 0, bottom: 0 });
@@ -29,7 +36,7 @@ export default function InvestissementSelect({ value, onChange, options = [] })
const selectedOption = options.find(i => String(i.id) === String(value));
const label = value === 'BONUS_PARRAINAGE' ? '🎁 Bonus Parrainage'
: value === 'BONUS_PLATEFORME' ? '🏆 Bonus Plateforme'
: value === 'INTERETS_PLATEFORME' ? '🏦 Intérêts plateforme'
: value === 'INTERETS_PLATEFORME' ? interetsPlateformeLabel
: selectedOption ? `${selectedOption.plateforme_nom} — ${selectedOption.nom_projet} (${fmtEUR(selectedOption.montant_investi)})`
: null;
@@ -124,7 +131,7 @@ export default function InvestissementSelect({ value, onChange, options = [] })
<button type="button" style={rowStyle(value === '')} onClick={() => select('')}>—</button>
<button type="button" style={rowStyle(value === 'BONUS_PARRAINAGE')} onClick={() => select('BONUS_PARRAINAGE')}>🎁 Bonus Parrainage</button>
<button type="button" style={rowStyle(value === 'BONUS_PLATEFORME')} onClick={() => select('BONUS_PLATEFORME')}>🏆 Bonus Plateforme</button>
<button type="button" style={rowStyle(value === 'INTERETS_PLATEFORME')} onClick={() => select('INTERETS_PLATEFORME')}>🏦 Intérêts plateforme</button>
<button type="button" style={rowStyle(value === 'INTERETS_PLATEFORME')} onClick={() => select('INTERETS_PLATEFORME')}>{interetsPlateformeLabel}</button>
<div className="cat-select-sep" />
{options.map(i => (
<button key={i.id} type="button" style={rowStyle(String(value) === String(i.id))} onClick={() => select(String(i.id))}>