import { Modal, showConfirm } from "@/app/components/ui-lib"; import { useChatStore } from "@/app/store/chat"; import { useMaskStore } from "@/app/store/mask"; import { useNavigate } from "react-router-dom"; import Locale from "@/app/locales"; import { IconButton } from "@/app/components/button"; import { Path } from "@/app/constant"; import ResetIcon from "@/app/icons/reload.svg"; import CopyIcon from "@/app/icons/copy.svg"; import MaskConfig from "@/app/containers/Settings/MaskConfig"; import { ListItem } from "@/app/components/List"; export default function SessionConfigModel(props: { onClose: () => void }) { const chatStore = useChatStore(); const session = chatStore.currentSession(); const maskStore = useMaskStore(); const navigate = useNavigate(); return (
props.onClose()} actions={[ } bordered text={Locale.Chat.Config.Reset} onClick={async () => { if (await showConfirm(Locale.Memory.ResetConfirm)) { chatStore.updateCurrentSession( (session) => (session.memoryPrompt = ""), ); } }} />, } bordered text={Locale.Chat.Config.SaveAs} onClick={() => { navigate(Path.Masks); setTimeout(() => { maskStore.create(session.mask); }, 500); }} />, ]} > { const mask = { ...session.mask }; updater(mask); chatStore.updateCurrentSession((session) => (session.mask = mask)); }} shouldSyncFromGlobal extraListItems={ session.mask.modelConfig.sendMemory ? ( ) : ( <> ) } >
); }