fix: tooltip type inference for Recharts strict mode
This commit is contained in:
@@ -163,9 +163,11 @@ export function SqlExplorerPage() {
|
||||
: [];
|
||||
|
||||
// Custom tooltip that shows all row values on hover
|
||||
const renderTooltip = (props: { active?: boolean; payload?: Array<{ payload: Record<string, unknown> }> }) => {
|
||||
if (!props.active || !props.payload?.length || !result) return null;
|
||||
const data = props.payload[0].payload;
|
||||
const renderTooltip = ({ active, payload }: Record<string, unknown>) => {
|
||||
if (!active || !result) return null;
|
||||
const items = payload as Array<{ payload: Record<string, unknown> }> | undefined;
|
||||
if (!items?.length) return null;
|
||||
const data = items[0].payload;
|
||||
return (
|
||||
<div className="rounded-lg border border-surface-700 bg-surface-900 px-3 py-2 text-xs shadow-lg">
|
||||
{result.columns.map((col, i) => {
|
||||
|
||||
Reference in New Issue
Block a user