import { ChatStore, ChatStoreMessage } from "@/types/chatstore"; import { isVailedJSON } from "@/message"; import { calculate_token_length } from "@/chatgpt"; import { Tr } from "@/translate"; import { Textarea } from "@/components/ui/textarea"; import { useContext } from "react"; import { AppContext } from "./pages/App"; interface Props { chat: ChatStoreMessage; setShowEdit: (se: boolean) => void; } export function EditMessageString({ chat, setShowEdit }: Props) { const ctx = useContext(AppContext); if (!ctx) return