mirror of
https://github.com/supabase/supabase.git
synced 2026-10-11 04:15:04 +03:00
* **Chores** * Updated internal module import paths across hook files to use standardized path aliases for improved code consistency and maintainability.
21 lines
549 B
TypeScript
21 lines
549 B
TypeScript
import { LOCAL_STORAGE_KEYS } from 'common'
|
|
import { Dispatch, SetStateAction } from 'react'
|
|
|
|
import { useLocalStorageQuery } from '@/hooks/misc/useLocalStorage'
|
|
|
|
/**
|
|
* Returns which schemas are ok to be sent to AI.
|
|
*/
|
|
export function useSchemasForAi(
|
|
ref: string
|
|
): readonly [string[], Dispatch<SetStateAction<string[]>>] {
|
|
const [enabledSchemas, setEnabledSchemas] = useLocalStorageQuery(
|
|
LOCAL_STORAGE_KEYS.SQL_EDITOR_AI_SCHEMA(ref),
|
|
['public']
|
|
)
|
|
|
|
if (!ref) return [[], () => {}]
|
|
|
|
return [enabledSchemas, setEnabledSchemas]
|
|
}
|