mirror of
https://github.com/ItzCrazyKns/Perplexica.git
synced 2025-10-13 19:18:14 +00:00
feat(config): add client side and server side config registries
This commit is contained in:
13
src/lib/config/clientRegistry.ts
Normal file
13
src/lib/config/clientRegistry.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
"use client"
|
||||
|
||||
const getClientConfig = (key: string, defaultVal?: any) => {
|
||||
return localStorage.getItem(key) ?? defaultVal ?? undefined
|
||||
}
|
||||
|
||||
export const getTheme = () => getClientConfig('theme', 'dark')
|
||||
|
||||
export const getAutoImageSearch = () => Boolean(getClientConfig('autoImageSearch', 'true'))
|
||||
|
||||
export const getAutoVideoSearch = () => Boolean(getClientConfig('autoVideoSearch', 'true'))
|
||||
|
||||
export const getSystemInstructions = () => getClientConfig('systemInstructions', '')
|
1
src/lib/config/serverRegistry.ts
Normal file
1
src/lib/config/serverRegistry.ts
Normal file
@@ -0,0 +1 @@
|
||||
/* TODO: add server opts */
|
Reference in New Issue
Block a user