Database diagrams editor that allows you to visualize and design your DB with a single query.
TypeScript databasedbdb-migrationeditorerdmariadbmssqlmysqlpostgresqlreactreact-flowschema-migrationssqlsqlitetypescriptvisualizationxyflow
menus
Guy Ben-Aharon4f84fd1065e7
diff --git a/src/pages/editor-page/canvas/table-node.tsx b/src/pages/editor-page/canvas/table-node.tsxindex 6dded806..9fd44237 100644--- a/src/pages/editor-page/canvas/table-node.tsx+++ b/src/pages/editor-page/canvas/table-node.tsx@@ -1,6 +1,8 @@import React from 'react';import { randomHSLA } from '@/lib/utils';import { Handle, Position, NodeProps, Node } from '@xyflow/react';+import { Button } from '@/components/button/button';+import { Ellipsis, Trash2 } from 'lucide-react';export type TableNodeProps = Node<Record<string, never>, 'table'>;@@ -12,7 +14,7 @@ export const TableNode: React.FC<NodeProps<TableNodeProps>> = ({const focused = selected && !dragging;const renderColumn = () => (- <div className="flex relative items-center h-8 text-sm px-3 border-t justify-between hover:bg-secondary">+ <div className="flex relative items-center h-8 text-sm px-3 border-t justify-between hover:bg-primary-foreground group last:rounded-b-lg">{focused ? (<HandleclassName="!h-3 !w-3 !bg-slate-400"@@ -21,8 +23,21 @@ export const TableNode: React.FC<NodeProps<TableNodeProps>> = ({isConnectable={true}/>) : null}- <div>id</div>- <div className="text-muted-foreground">bigint</div>+ <div className="flex">id</div>+ <div className="flex">+ <div className="text-muted-foreground flex group-hover:hidden">+ bigint+ </div>+ <div className="flex-row hidden group-hover:flex">+ <Button+ variant="ghost"+ className="hover:bg-primary-foreground p-0 w-6 h-6"+ >+ <Trash2 className="h-3.5 w-3.5 text-red-700" />+ </Button>+ </div>+ </div>+{focused ? (<HandleclassName="!h-3 !w-3 !bg-slate-400"@@ -42,8 +57,16 @@ export const TableNode: React.FC<NodeProps<TableNodeProps>> = ({className="h-2 rounded-t-lg"style={{ backgroundColor: tableColor }}></div>- <div className="flex items-center h-9 text-sm font-bold bg-secondary px-2">- table_1+ <div className="flex items-center h-9 bg-secondary px-2 justify-between group">+ <div className="flex text-sm font-bold">table_1</div>+ <div className="flex-row hidden group-hover:flex">+ <Button+ variant="ghost"+ className="hover:bg-primary-foreground p-0 w-6 h-6 text-slate-500 hover:text-slate-700"+ >+ <Ellipsis className="h-4 w-4" />+ </Button>+ </div></div>{renderColumn()}{renderColumn()}