import { Database, Circle, Key } from 'lucide-react'; import { Handle, Position } from '@xyflow/react'; import { TableSchema } from '@insforge/shared-schemas'; interface TableNodeProps { data: { table: TableSchema; referencedColumns?: string[]; // List of column names that are referenced by other tables showRecordCount?: boolean; // Control whether to show record count }; } export function TableNode({ data }: TableNodeProps) { const { table, referencedColumns = [], showRecordCount = true } = data; const getColumnIcon = (isReferenced: boolean = false) => { // If column is referenced by another table (has incoming connections) // Show outer gray diamond with inner white diamond if (isReferenced) { return (
{table.recordCount !== undefined ? `${table.recordCount.toLocaleString()} data` : '0 data'}
)}No columns defined