import Spotlight from '@/components/spotlight'; import { Spin } from '@/components/ui/spin'; import classNames from 'classnames'; import { useState } from 'react'; import { useTranslation } from 'react-i18next'; import FormatPreserveEditor from './components/parse-editer'; import RerunButton from './components/rerun-button'; import { useFetchParserList, useFetchPaserText } from './hooks'; const ParserContainer = () => { const { data: initialValue, rerun: onSave } = useFetchPaserText(); const { t } = useTranslation(); const { loading } = useFetchParserList(); const [initialText, setInitialText] = useState(initialValue); const [isChange, setIsChange] = useState(false); const handleSave = (newContent: string) => { console.log('保存内容:', newContent); if (newContent !== initialText) { setIsChange(true); onSave(newContent); } else { setIsChange(false); } // Here, the API is called to send newContent to the backend }; return ( <> {isChange && (