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
|
// 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) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user