Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions app/src/pages/Inversores.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@
label: format(d.date, 'd MMM', { locale: dateLocale() }),
kwh: d.productionKwh * share,
})),
[getHistory, share, i18n.language],

Check warning on line 75 in app/src/pages/Inversores.tsx

View workflow job for this annotation

GitHub Actions / frontend

React Hook useMemo has an unnecessary dependency: 'i18n.language'. Either exclude it or remove the dependency array
);

return (
Expand Down Expand Up @@ -530,9 +530,11 @@
kwp: m.kwp,
}));

// Solo se ofrece la comparativa cuando hay varios inversores; las vistas
// individuales por inversor se eliminaron (issue #70).
const tabKeys = useMemo(() => {
const keys = invMetas.map((m) => m.key);
return invMetas.length >= 2 ? ['compare', ...keys] : keys;
return invMetas.length >= 2 ? ['compare'] : keys;
}, [invMetas]);

const tabParam = searchParams.get('tab');
Expand Down Expand Up @@ -573,7 +575,8 @@
return (
<TooltipProvider delayDuration={200}>
<div className="flex flex-col gap-4 lg:gap-5">
{/* ── §1 Segmented control (sticky en móvil) ────────────── */}
{/* ── §1 Segmented control (sticky en móvil) — solo con varias vistas ── */}
{tabKeys.length > 1 && (
<motion.div
initial={{ opacity: 0, y: 16 }}
animate={{ opacity: 1, y: 0 }}
Expand Down Expand Up @@ -618,6 +621,7 @@
})}
</div>
</motion.div>
)}

{/* ── Contenido por pestaña (crossfade + y 8px) ─────────── */}
<AnimatePresence mode="wait">
Expand Down
Loading