refactor: seperate AppContext and AppChatStoreContext

This commit is contained in:
2025-01-08 01:09:50 +08:00
parent 20a152b899
commit b68224b13b
14 changed files with 328 additions and 290 deletions

View File

@@ -15,16 +15,14 @@ import {
import { Button } from "./ui/button";
import { useContext } from "react";
import { AppContext } from "../pages/App";
import { AppChatStoreContext, AppContext } from "../pages/App";
interface Props {
chat: ChatStoreMessage;
setShowEdit: (se: boolean) => void;
}
export function EditMessageDetail({ chat, setShowEdit }: Props) {
const ctx = useContext(AppContext);
const { chatStore, setChatStore } = ctx;
const { chatStore, setChatStore } = useContext(AppChatStoreContext);
if (typeof chat.content !== "object") return <div>error</div>;
return (