1
1
// client/packages/lowcoder/src/comps/comps/chatComp/chatView.tsx
2
2
import React from "react" ;
3
3
import { ChatCompProps } from "./chatCompTypes" ;
4
+ import { Thread } from "./components/assistant-ui/thread" ;
4
5
5
6
// Import assistant-ui components and proper runtime
6
7
import {
7
8
AssistantRuntimeProvider ,
8
- ThreadPrimitive ,
9
- ComposerPrimitive
10
9
} from "@assistant-ui/react" ;
11
10
import { useChatRuntime } from "@assistant-ui/react-ai-sdk" ;
12
11
import "@assistant-ui/styles/index.css" ;
@@ -20,65 +19,7 @@ export const ChatView = React.memo((props: ChatCompProps) => {
20
19
21
20
return (
22
21
< AssistantRuntimeProvider runtime = { runtime } >
23
- < div style = { {
24
- height : '100%' ,
25
- padding : '16px' ,
26
- backgroundColor : '#f5f5f5'
27
- } } >
28
- < div className = "aui-root" >
29
- < h3 style = { { marginBottom : '16px' } } > 🚀 Assistant-UI with Vercel AI SDK!</ h3 >
30
-
31
- { /* Test Thread with real runtime */ }
32
- < div className = "aui-thread-root" style = { {
33
- background : 'white' ,
34
- borderRadius : '8px' ,
35
- padding : '16px' ,
36
- marginBottom : '16px' ,
37
- border : '1px solid #e0e0e0' ,
38
- minHeight : '200px'
39
- } } >
40
- < ThreadPrimitive . Empty >
41
- < div className = "aui-thread-welcome-root" >
42
- < div className = "aui-thread-welcome-center" >
43
- < p className = "aui-thread-welcome-message" >
44
- { props . text } - Runtime Working! 🎉
45
- </ p >
46
- </ div >
47
- </ div >
48
- </ ThreadPrimitive . Empty >
49
- </ div >
50
-
51
- { /* Test Composer with real runtime */ }
52
- < div className = "aui-composer-root" style = { {
53
- background : 'white' ,
54
- borderRadius : '8px' ,
55
- padding : '12px' ,
56
- border : '1px solid #e0e0e0'
57
- } } >
58
- < ComposerPrimitive . Input
59
- placeholder = { props . text }
60
- disabled = { false }
61
- className = "aui-composer-input"
62
- rows = { 1 }
63
- />
64
- </ div >
65
-
66
- { /* Property status */ }
67
- < div style = { {
68
- marginTop : '16px' ,
69
- fontSize : '12px' ,
70
- color : '#666' ,
71
- background : 'white' ,
72
- padding : '8px' ,
73
- borderRadius : '4px' ,
74
- border : '1px solid #e0e0e0'
75
- } } >
76
- < strong > ✅ Test Status:</ strong > < br />
77
- Text: { props . text } < br />
78
- Runtime: Vercel AI SDK ✅
79
- </ div >
80
- </ div >
81
- </ div >
22
+ < Thread />
82
23
</ AssistantRuntimeProvider >
83
24
) ;
84
25
} ) ;
0 commit comments