feat: 暂存添加ai chat and prompt generate
This commit is contained in:
38
src/pages/ai-chat/AiModule.tsx
Normal file
38
src/pages/ai-chat/AiModule.tsx
Normal 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>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user