feat: add chat history and edit

This commit is contained in:
2024-09-30 02:53:13 +08:00
parent 029710f31c
commit 441b94a061
10 changed files with 269 additions and 30 deletions

View File

@@ -10,6 +10,7 @@ import { EditOutlined, SettingOutlined, LinkOutlined, SaveOutlined, DeleteOutlin
import clsx from 'clsx';
import { isObjectNull } from '@/utils/is-null';
import { CardBlank } from '@/components/card/CardBlank';
import { useAiStore } from '@/pages/ai-chat';
const FormModal = () => {
const [form] = Form.useForm();
const containerStore = useContainerStore(
@@ -103,6 +104,15 @@ export const ContainerList = () => {
};
}),
);
const aiStore = useAiStore(
useShallow((state) => {
return {
open: state.open,
setOpen: state.setOpen,
setData: state.setData,
};
}),
);
const [codeEdit, setCodeEdit] = useState(false);
const [code, setCode] = useState('');
useEffect(() => {
@@ -212,7 +222,12 @@ export const ContainerList = () => {
icon={<LinkOutlined />}></Button>
</Tooltip>
<Tooltip title='ai编程'>
<Button onClick={(e) => {}} icon={<MessageOutlined />}></Button>
<Button
onClick={(e) => {
aiStore.setOpen(true);
// aiStore.setData({ ...containerStore.formData });
}}
icon={<MessageOutlined />}></Button>
</Tooltip>
</div>
</div>