import { Button, // Divider, Empty, Space } from "antd"; import './ai-helper-text.css' import TextArea from "antd/es/input/TextArea"; import { useEffect, useState } from "react"; // import { CheckOutlined, EditOutlined, ReloadOutlined } from "@ant-design/icons"; import { get } from "../../../util/AjaxUtils.ts"; import { useParams } from "react-router-dom"; import noTextImg from '../../../static/noText.png' import { message } from "antd"; type PropsType = { title: string; maxLength: number; text: string; newText: string; handleGenerate: () => void; handleSave: (newText: string) => void; } export default function AiHelperText(props: PropsType) { const height = window.innerHeight - 265; const pathParams = useParams(); const [status, setStatus] = useState('') useEffect(() => { get({ messageApi, url: `/api/proj/get/${pathParams.projId}`, onSuccess({ data }) { console.log('其他页面状态判断', data); setStatus(data.generate.generateStatus) } }) }, []) const [messageApi] = message.useMessage(); const [text, setText] = useState(''); const [newText, setNewText] = useState(''); const [isTextEdit, setIsTextEdit] = useState(false); // const [isNewTextEdit, setIsNewTextEdit] = useState(false); useEffect(() => { setText(props.text); setNewText(props.newText); }, [props.text, props.newText]) // const renderTextBtn = () => { // if (!newText) { // if (!isTextEdit) { // return ( // // // { // text ? ( // // ) : <> // } // // ) // } // return ( // // // // ) // } // if (!isNewTextEdit) { // return ( // // // // // // ) // } // return ( // // // // ) // } // const renderTextDom = () => { // if (!text) { // return // } // if (!isTextEdit) { // return (
{text}
) // } // return ( // ) } // const renderNewTextDom = () => { // if (!newText) { // return <> // } // if (!isNewTextEdit) { // return ( // <> // 新{props.title} //
{newText}
// // ) // } // return ( // <> // 新{props.title} //