import { QueryResultChart } from './QueryResultChart' import { QueryResultError } from './QueryResultError' import { type QueryResult } from './types' import { DataGridResults } from '@/components/ui/DataGridResults' import { type ChartConfig } from '@/data/content/notebooks/notebook-schema' interface QueryResultRendererProps { result?: QueryResult view?: 'table' | 'chart' chart?: ChartConfig } export const QueryResultRenderer = ({ result, view, chart }: QueryResultRendererProps) => { const { rows, error, autoLimit } = result ?? {} if (!result) { return
Run the query to see results
} if (error) { returnSuccess. No rows returned
} if (rows && rows.length > 0) { if (view === 'table') return