modified: frontend/src/pages/DatabaseSchema.tsx
This commit is contained in:
@@ -1,4 +1,4 @@
|
|||||||
import { useState, useCallback, useMemo } from 'react';
|
import { useState, useMemo } from 'react';
|
||||||
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
import { useQuery, useMutation, useQueryClient } from '@tanstack/react-query';
|
||||||
import {
|
import {
|
||||||
ReactFlow,
|
ReactFlow,
|
||||||
@@ -17,7 +17,7 @@ import { databasesApi, schemaApi, TableInfo, SchemaData } from '@/services/api';
|
|||||||
import { Database } from '@/types';
|
import { Database } from '@/types';
|
||||||
|
|
||||||
// Custom node for table
|
// Custom node for table
|
||||||
function TableNode({ data }: { data: TableInfo }) {
|
function TableNode({ data }: { data: TableInfo & Record<string, unknown> }) {
|
||||||
return (
|
return (
|
||||||
<div className="bg-white border-2 border-gray-300 rounded-lg shadow-lg min-w-64 overflow-hidden">
|
<div className="bg-white border-2 border-gray-300 rounded-lg shadow-lg min-w-64 overflow-hidden">
|
||||||
{/* Table header */}
|
{/* Table header */}
|
||||||
@@ -89,7 +89,7 @@ function generateNodesAndEdges(schema: SchemaData): { nodes: Node[]; edges: Edge
|
|||||||
id: fullName,
|
id: fullName,
|
||||||
type: 'table',
|
type: 'table',
|
||||||
position: { x, y },
|
position: { x, y },
|
||||||
data: table,
|
data: { ...table } as TableInfo & Record<string, unknown>,
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user