23 lines
571 B
TypeScript
23 lines
571 B
TypeScript
|
|
import { create } from 'zustand';
|
||
|
|
import { ChatSettingType } from '@/app/(main)/chat/[id]/stream-chat';
|
||
|
|
|
||
|
|
interface ChatDrawerStore {
|
||
|
|
setting: ChatSettingType;
|
||
|
|
setSetting: (setting: Partial<ChatSettingType>) => void;
|
||
|
|
}
|
||
|
|
|
||
|
|
export const useChatDrawerStore = create<ChatDrawerStore>((set, get) => ({
|
||
|
|
setting: {
|
||
|
|
chatModel: '',
|
||
|
|
longText: 0,
|
||
|
|
maximumReplies: 0,
|
||
|
|
background: '',
|
||
|
|
font: 16,
|
||
|
|
voiceActor: '',
|
||
|
|
},
|
||
|
|
setSetting: (value: Partial<ChatSettingType>) => {
|
||
|
|
const { setting } = get();
|
||
|
|
set({ setting: { ...setting, ...value } });
|
||
|
|
},
|
||
|
|
}));
|