mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-11-13 12:43:42 +08:00
sync upstream code
This commit is contained in:
@@ -31,6 +31,8 @@ import AutoIcon from "../icons/auto.svg";
|
||||
import BottomIcon from "../icons/bottom.svg";
|
||||
import StopIcon from "../icons/pause.svg";
|
||||
import RobotIcon from "../icons/robot.svg";
|
||||
import SearchCloseIcon from "../icons/search_close.svg";
|
||||
import SearchOpenIcon from "../icons/search_open.svg";
|
||||
|
||||
import {
|
||||
ChatMessage,
|
||||
@@ -388,6 +390,14 @@ export function ChatActions(props: {
|
||||
const navigate = useNavigate();
|
||||
const chatStore = useChatStore();
|
||||
|
||||
// switch web search
|
||||
const webSearch = chatStore.currentSession().webSearch;
|
||||
function switchWebSearch() {
|
||||
chatStore.updateCurrentSession((session) => {
|
||||
session.webSearch = !session.webSearch;
|
||||
});
|
||||
}
|
||||
|
||||
// switch themes
|
||||
const theme = config.theme;
|
||||
function nextTheme() {
|
||||
@@ -489,6 +499,16 @@ export function ChatActions(props: {
|
||||
text={currentModel}
|
||||
icon={<RobotIcon />}
|
||||
/>
|
||||
|
||||
<ChatAction
|
||||
onClick={switchWebSearch}
|
||||
text={
|
||||
webSearch
|
||||
? Locale.Chat.InputActions.CloseWebSearch
|
||||
: Locale.Chat.InputActions.OpenWebSearch
|
||||
}
|
||||
icon={webSearch ? <SearchOpenIcon /> : <SearchCloseIcon />}
|
||||
/>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user