初始化模版工程
This commit is contained in:
33
app/page.tsx
Normal file
33
app/page.tsx
Normal file
@@ -0,0 +1,33 @@
|
||||
'use client';
|
||||
|
||||
import { ImageEditor, ImageEditorHandle } from '@/components/image-editor';
|
||||
import { NovaChat } from '@/components/nova-sdk';
|
||||
import { useBuildConversationConnect } from '@/components/nova-sdk/hooks';
|
||||
import { useImages } from '@/components/nova-sdk/store/useImages';
|
||||
import { useRef } from 'react';
|
||||
|
||||
const ChatWithImageEditor = () => {
|
||||
const imageEditorRef = useRef<ImageEditorHandle>(null);
|
||||
const { conversationId, platformConfig } = useBuildConversationConnect();
|
||||
useImages(imageEditorRef)
|
||||
|
||||
return (
|
||||
<div className="w-full h-screen flex">
|
||||
<div className="w-1/2 flex-shrink-0">
|
||||
{conversationId && (
|
||||
<ImageEditor taskId={conversationId} ref={imageEditorRef} />
|
||||
)}
|
||||
</div>
|
||||
<div className="w-1/2">
|
||||
<NovaChat
|
||||
platformConfig={platformConfig}
|
||||
conversationId={conversationId}
|
||||
agentId={platformConfig.agentId}
|
||||
panelMode={'dialog'}
|
||||
/>
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
};
|
||||
|
||||
export default ChatWithImageEditor;
|
||||
Reference in New Issue
Block a user