mirror of
https://github.com/supabase/supabase.git
synced 2026-10-06 09:55:06 +03:00
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Ivan Vasilov <vasilov.ivan@gmail.com>
25 lines
754 B
TypeScript
25 lines
754 B
TypeScript
import { LOCAL_STORAGE_KEYS } from 'common'
|
|
import type { PropsWithChildren } from 'react'
|
|
import { CommandProvider } from 'ui-patterns/CommandMenu'
|
|
|
|
import { useLocalStorageQuery } from '@/hooks/misc/useLocalStorage'
|
|
import { useStudioCommandMenuTelemetry } from '@/hooks/misc/useStudioCommandMenuTelemetry'
|
|
|
|
export function StudioCommandProvider({ children }: PropsWithChildren) {
|
|
const { onTelemetry } = useStudioCommandMenuTelemetry()
|
|
const [commandMenuHotkeyEnabled] = useLocalStorageQuery<boolean>(
|
|
LOCAL_STORAGE_KEYS.HOTKEY_COMMAND_MENU,
|
|
true
|
|
)
|
|
|
|
return (
|
|
<CommandProvider
|
|
app="studio"
|
|
onTelemetry={onTelemetry}
|
|
openKey={commandMenuHotkeyEnabled ? 'k' : ''}
|
|
>
|
|
{children}
|
|
</CommandProvider>
|
|
)
|
|
}
|