import type { SqlRow } from '../types' interface SqlPreviewTableProps { rows?: SqlRow[] | null emptyLabel: string } function formatCell(cell: SqlRow[number]) { if (cell === null) return 'NULL' if (typeof cell === 'number') return Number.isInteger(cell) ? cell.toString() : cell.toFixed(2) return String(cell) } export function SqlPreviewTable({ rows, emptyLabel }: SqlPreviewTableProps) { if (!rows || rows.length === 0) { return (
| {rowIndex} | {row.map((cell, cellIndex) => ({formatCell(cell)} | ))}