From ffd36cc2e406d97558ca68379047d93df48734fb Mon Sep 17 00:00:00 2001 From: Joshen Lim Date: Mon, 6 May 2024 17:17:42 +0800 Subject: [PATCH] temp --- apps/studio/components/interfaces/SQLEditor/SQLEditor.tsx | 4 +--- apps/studio/state/sql-editor-v2.ts | 5 +++++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/apps/studio/components/interfaces/SQLEditor/SQLEditor.tsx b/apps/studio/components/interfaces/SQLEditor/SQLEditor.tsx index e6e1c09fa3d..afc0c35990b 100644 --- a/apps/studio/components/interfaces/SQLEditor/SQLEditor.tsx +++ b/apps/studio/components/interfaces/SQLEditor/SQLEditor.tsx @@ -24,6 +24,7 @@ import { uuidv4 } from 'lib/helpers' import { useProfile } from 'lib/profile' import { wrapWithRoleImpersonation } from 'lib/role-impersonation' import Telemetry from 'lib/telemetry' +import { Settings, X } from 'lucide-react' import { useAppStateSnapshot } from 'state/app-state' import { useDatabaseSelectorStateSnapshot } from 'state/database-selector' import { isRoleImpersonationEnabled, useGetImpersonatedRole } from 'state/role-impersonation-state' @@ -31,8 +32,6 @@ import { getSqlEditorStateSnapshot, useSqlEditorStateSnapshot } from 'state/sql- import { AiIconAnimation, IconCornerDownLeft, - IconSettings, - IconX, Input_Shadcn_, Loading, ResizableHandle, @@ -62,7 +61,6 @@ import { createSqlSnippetSkeleton, } from './SQLEditor.utils' import UtilityPanel from './UtilityPanel/UtilityPanel' -import { Settings, X } from 'lucide-react' // Load the monaco editor client-side only (does not behave well server-side) const MonacoEditor = dynamic(() => import('./MonacoEditor'), { ssr: false }) diff --git a/apps/studio/state/sql-editor-v2.ts b/apps/studio/state/sql-editor-v2.ts index 1ef9840e53a..f37e5aba81c 100644 --- a/apps/studio/state/sql-editor-v2.ts +++ b/apps/studio/state/sql-editor-v2.ts @@ -112,3 +112,8 @@ export const sqlEditorState = proxy({ sqlEditorState.needsSaving.delete(id) }, }) + +export const getSqlEditorV2StateSnapshot = () => snapshot(sqlEditorState) + +export const useSqlEditorV2StateSnapshot = (options?: Parameters[1]) => + useSnapshot(sqlEditorState, options)