feat: 暂存添加ai chat and prompt generate

This commit is contained in:
2024-09-26 01:18:04 +08:00
parent 3da62fd254
commit 553e4d62f0
16 changed files with 1265 additions and 60 deletions

View File

@@ -0,0 +1,38 @@
import { useShallow } from 'zustand/react/shallow';
import { useAiStore } from './store/ai-store';
import { CloseOutlined } from '@ant-design/icons';
import { Button } from 'antd';
export const AiMoudle = () => {
const aiStore = useAiStore(
useShallow((state) => {
return {
open: state.open,
setOpen: state.setOpen,
runAi: state.runAi,
};
}),
);
if (!aiStore.open) {
return null;
}
return (
<div className='w-96 flex-shrink-0 bg-gray-100 border-l-2 shadow-lg flex flex-col'>
<div className='flex gap-4 bg-slate-400 p-2'>
<Button className='position ml-4 !bg-slate-400 !border-black' onClick={() => aiStore.setOpen(false)} icon={<CloseOutlined />}></Button>
<h1 className='ml-10'>Ai Moudle</h1>
</div>
<div className='flex-grow p-2'>
<div> chat message</div>
<div>
<Button
onClick={() => {
aiStore.runAi();
}}>
Send
</Button>
</div>
</div>
</div>
);
};