mirror of
https://github.com/ChatGPTNextWeb/ChatGPT-Next-Web.git
synced 2025-11-11 11:43:42 +08:00
feat: function delete chat dev done
This commit is contained in:
46
app/containers/Chat/components/ClearContextDivider.tsx
Normal file
46
app/containers/Chat/components/ClearContextDivider.tsx
Normal file
@@ -0,0 +1,46 @@
|
||||
import { useChatStore } from "@/app/store/chat";
|
||||
import Locale from "@/app/locales";
|
||||
import { useAppConfig } from "@/app/store";
|
||||
|
||||
export default function ClearContextDivider() {
|
||||
const chatStore = useChatStore();
|
||||
const { isMobileScreen } = useAppConfig();
|
||||
|
||||
return (
|
||||
<div
|
||||
className={`mt-6 mb-8 flex items-center justify-center gap-2.5 max-md:cursor-pointer`}
|
||||
onClick={() => {
|
||||
if (!isMobileScreen) {
|
||||
return;
|
||||
}
|
||||
chatStore.updateCurrentSession(
|
||||
(session) => (session.clearContextIndex = undefined),
|
||||
);
|
||||
}}
|
||||
>
|
||||
<div className="bg-chat-panel-message-clear-divider h-[1px] w-10"> </div>
|
||||
<div className="flex items-center justify-between gap-1 text-sm">
|
||||
<div className={`text-text-chat-panel-message-clear`}>
|
||||
{Locale.Context.Clear}
|
||||
</div>
|
||||
<div
|
||||
className={`
|
||||
text-text-chat-panel-message-clear-revert underline font-common
|
||||
md:cursor-pointer
|
||||
`}
|
||||
onClick={() => {
|
||||
if (isMobileScreen) {
|
||||
return;
|
||||
}
|
||||
chatStore.updateCurrentSession(
|
||||
(session) => (session.clearContextIndex = undefined),
|
||||
);
|
||||
}}
|
||||
>
|
||||
{Locale.Context.Revert}
|
||||
</div>
|
||||
</div>
|
||||
<div className="bg-chat-panel-message-clear-divider h-[1px] w-10"> </div>
|
||||
</div>
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user