fix: tooltip type inference for Recharts strict mode

This commit is contained in:
Celes Renata
2026-04-16 06:01:29 +00:00
parent 79a85723b6
commit 1ccea17600
+5 -3
View File
@@ -163,9 +163,11 @@ export function SqlExplorerPage() {
: []; : [];
// Custom tooltip that shows all row values on hover // Custom tooltip that shows all row values on hover
const renderTooltip = (props: { active?: boolean; payload?: Array<{ payload: Record<string, unknown> }> }) => { const renderTooltip = ({ active, payload }: Record<string, unknown>) => {
if (!props.active || !props.payload?.length || !result) return null; if (!active || !result) return null;
const data = props.payload[0].payload; const items = payload as Array<{ payload: Record<string, unknown> }> | undefined;
if (!items?.length) return null;
const data = items[0].payload;
return ( return (
<div className="rounded-lg border border-surface-700 bg-surface-900 px-3 py-2 text-xs shadow-lg"> <div className="rounded-lg border border-surface-700 bg-surface-900 px-3 py-2 text-xs shadow-lg">
{result.columns.map((col, i) => { {result.columns.map((col, i) => {