feat: Implement core chat functionality with LM Studio integration and theme management.
This commit is contained in:
1 parent
93df87d7e9
commit
0297db110a
13 files changed
+670
-451
No files matched your search
@@ -0,0 +1,31 @@
|
||||
import { Colors } from '@/constants/Colors';
|
||||
import { useColorScheme } from '@/hooks/useColorScheme';
|
||||
import { useAppStore } from '@/store/useAppStore';
|
||||
|
||||
type ThemeType = 'light' | 'dark';
|
||||
type ColorObj = typeof Colors.light & typeof Colors.dark;
|
||||
|
||||
// Overloads para resolver o erro TSC
|
||||
export function useThemeColor(props: { light?: string; dark?: string }, colorName: keyof ColorObj): string;
|
||||
export function useThemeColor(): ColorObj;
|
||||
export function useThemeColor(
|
||||
props?: { light?: string; dark?: string },
|
||||
colorName?: keyof ColorObj
|
||||
): string | ColorObj {
|
||||
const themePreference = useAppStore((state) => state.theme);
|
||||
const systemColorScheme = useColorScheme() ?? 'light';
|
||||
|
||||
const theme: ThemeType = themePreference === 'system'
|
||||
? systemColorScheme
|
||||
: (themePreference as ThemeType);
|
||||
|
||||
if (props && props[theme]) {
|
||||
return props[theme] as string;
|
||||
}
|
||||
|
||||
if (colorName) {
|
||||
return Colors[theme][colorName];
|
||||
}
|
||||
|
||||
return Colors[theme];
|
||||
}
|
||||
Reference in new issue
Block a user