mirror of
https://github.com/enricoros/big-AGI.git
synced 2026-05-11 14:10:15 -07:00
39 lines
923 B
TypeScript
39 lines
923 B
TypeScript
import { create } from 'zustand';
|
|
import { persist } from 'zustand/middleware';
|
|
|
|
|
|
interface ModuleGoogleSearchStore {
|
|
|
|
// Google Custom Search settings
|
|
|
|
googleCloudApiKey: string;
|
|
setGoogleCloudApiKey: (googleApiKey: string) => void;
|
|
|
|
googleCSEId: string;
|
|
setGoogleCSEId: (cseId: string) => void;
|
|
|
|
restrictToDomain: string;
|
|
setRestrictToDomain: (domain: string) => void;
|
|
|
|
}
|
|
|
|
export const useGoogleSearchStore = create<ModuleGoogleSearchStore>()(
|
|
persist(
|
|
(set) => ({
|
|
|
|
// Google Custom Search settings
|
|
|
|
googleCloudApiKey: '',
|
|
setGoogleCloudApiKey: (googleApiKey: string) => set({ googleCloudApiKey: googleApiKey }),
|
|
|
|
googleCSEId: '',
|
|
setGoogleCSEId: (cseId: string) => set({ googleCSEId: cseId }),
|
|
|
|
restrictToDomain: '',
|
|
setRestrictToDomain: (domain: string) => set({ restrictToDomain: domain }),
|
|
|
|
}),
|
|
{
|
|
name: 'app-module-google-search',
|
|
}),
|
|
); |