diff --git a/src/components/gui/query-explanation-diagram/index.tsx b/src/components/gui/query-explanation-diagram/index.tsx index 97491968..c7dc1d8a 100644 --- a/src/components/gui/query-explanation-diagram/index.tsx +++ b/src/components/gui/query-explanation-diagram/index.tsx @@ -17,12 +17,14 @@ import { NestedLoop } from "./node-type/nested-loop"; import { TableBlock } from "./node-type/table-block"; import { OperationBlock } from "./node-type/operation-block"; import { UnionBlock } from "./node-type/union-block"; +import { useTheme } from "next-themes"; interface LayoutFlowProps { items: ExplanationMysql; } function QueryExplanationFlow(props: LayoutFlowProps) { + const { forcedTheme, resolvedTheme } = useTheme(); const [loading, setLoading] = useState(true); const [nodes, setNodes, onNodesChange] = useNodesState([]); const [edges, setEdges, onEdgesChange] = useEdgesState([]); @@ -56,8 +58,11 @@ function QueryExplanationFlow(props: LayoutFlowProps) { } }, [props, loading, setEdges, setNodes]); + const appTheme = (forcedTheme ?? resolvedTheme) as "dark" | "light"; + return ( x.position.y)) ?? 0; + : (Math.min(...layoutRelationship.nodes.map((x) => x.position.y)) ?? 0); // Calculate estimate area of the nodes without relationship const area = @@ -279,6 +280,7 @@ function mapSchema( } function LayoutFlow() { + const { forcedTheme, resolvedTheme } = useTheme(); const [nodes, setNodes, onNodesChange] = useNodesState([]); const [edges, setEdges, onEdgesChange] = useEdgesState([]); const { schema: initialSchema, currentSchemaName, refresh } = useSchema(); @@ -297,6 +299,8 @@ function LayoutFlow() { databaseSchema: DatabaseSchemaNode, }; + const appTheme = (forcedTheme ?? resolvedTheme) as "dark" | "light"; + return (
@@ -368,6 +372,7 @@ function LayoutFlow() { {selectedSchema && (
- +