Message lorsqu'aucun enregistrement présent
This commit is contained in:
@@ -10,6 +10,7 @@ import InteretsDonutChart from '../components/InteretsDonutChart.jsx';
|
||||
import { InteretsChartProvider, useInteretsChart } from '../context/InteretsChartContext.jsx';
|
||||
import TableauInteretsPlateforme from '../components/TableauInteretsPlateforme.jsx';
|
||||
import DrillCellPanel from '../components/DrillCellPanel.jsx';
|
||||
import EmptyState from '../components/EmptyState.jsx';
|
||||
|
||||
/* ── Sélecteur d'année — doit être enfant de InteretsChartProvider ── */
|
||||
function YearSelectorKpi() {
|
||||
@@ -422,6 +423,7 @@ export default function Dashboard() {
|
||||
const [loading, setLoading] = useState(false);
|
||||
const [capitalMensuelData, setCapitalMensuelData] = useState([]);
|
||||
const [plateformes, setPlateformes] = useState([]);
|
||||
const [platLoaded, setPlatLoaded] = useState(false);
|
||||
|
||||
/* ── drillCell : cellule sélectionnée dans le TIP — par défaut mois courant toutes plateformes ── */
|
||||
const _now = new Date();
|
||||
@@ -461,7 +463,7 @@ export default function Dashboard() {
|
||||
|
||||
useEffect(() => {
|
||||
api.get('/pfu').then(setPfuRates).catch(() => {});
|
||||
api.get('/plateformes').then(setPlateformes).catch(() => {});
|
||||
api.get('/plateformes').then(d => { setPlateformes(d); setPlatLoaded(true); }).catch(() => { setPlatLoaded(true); });
|
||||
}, []);
|
||||
|
||||
useEffect(() => {
|
||||
@@ -475,6 +477,12 @@ export default function Dashboard() {
|
||||
const ready = activeView === 'all' ? investisseurs.length > 0 : !!activeId;
|
||||
if (!ready) return <div className="card text-muted">Sélectionnez un compte investisseur.</div>;
|
||||
if (loading || !data) return <div className="card text-muted">Chargement…</div>;
|
||||
if (platLoaded && plateformes.length === 0) return (
|
||||
<>
|
||||
<div className="topbar"><h2>Tableau de bord</h2></div>
|
||||
<EmptyState />
|
||||
</>
|
||||
);
|
||||
|
||||
const { cash, cashByPlatform, portfolio, interets, interetsParAnnee } = data;
|
||||
const viewTitle = activeView === 'all'
|
||||
|
||||
Reference in New Issue
Block a user