feat: add tight border layout

This commit is contained in:
Yidadaa
2023-03-13 03:21:48 +08:00
parent 14d50f1167
commit ff0cf2f9dc
6 changed files with 66 additions and 42 deletions

View File

@@ -30,8 +30,18 @@ interface ChatConfig {
submitKey: SubmitKey;
avatar: string;
theme: Theme;
tightBorder: boolean;
}
const DEFAULT_CONFIG: ChatConfig = {
historyMessageCount: 5,
sendBotMessages: false as boolean,
submitKey: SubmitKey.CtrlEnter as SubmitKey,
avatar: "1fae0",
theme: Theme.Auto as Theme,
tightBorder: false,
};
interface ChatStat {
tokenCount: number;
wordCount: number;
@@ -94,6 +104,7 @@ interface ChatStore {
) => void;
getConfig: () => ChatConfig;
resetConfig: () => void;
updateConfig: (updater: (config: ChatConfig) => void) => void;
}
@@ -103,11 +114,11 @@ export const useChatStore = create<ChatStore>()(
sessions: [createEmptySession()],
currentSessionIndex: 0,
config: {
historyMessageCount: 5,
sendBotMessages: false as boolean,
submitKey: SubmitKey.CtrlEnter as SubmitKey,
avatar: "1fae0",
theme: Theme.Auto as Theme,
...DEFAULT_CONFIG,
},
resetConfig() {
set(() => ({ config: { ...DEFAULT_CONFIG } }));
},
getConfig() {