@@ -9,6 +9,14 @@ import { AppState } from "../../../redux/reducers";
9
9
import { getUser } from "../../../redux/selectors/usersSelectors" ;
10
10
import { connect } from "react-redux" ;
11
11
import { Layers } from "constants/Layers" ;
12
+ import Flex from "antd/es/flex" ;
13
+ import type { MenuProps } from 'antd/es/menu' ;
14
+ import { BuildOutlined , DatabaseOutlined } from "@ant-design/icons" ;
15
+ import Menu from "antd/es/menu/menu" ;
16
+ import { ChatView } from "@lowcoder-ee/comps/comps/chatComp/chatView" ;
17
+ import { AIGenerate } from "lowcoder-design" ;
18
+
19
+ type MenuItem = Required < MenuProps > [ 'items' ] [ number ] ;
12
20
13
21
const StyledResizableBox = styled ( ResizableBox ) `
14
22
position: relative;
@@ -26,6 +34,32 @@ const StyledResizableBox = styled(ResizableBox)`
26
34
}
27
35
` ;
28
36
37
+ const StyledMenu = styled ( Menu ) `
38
+ width: 40px;
39
+ padding: 6px 0;
40
+
41
+ .ant-menu-item {
42
+ height: 30px;
43
+ line-height: 30px;
44
+ }
45
+ ` ;
46
+
47
+ const ChatHeader = styled . div `
48
+ flex: 0 0 35px;
49
+ padding: 0 16px;
50
+ display: flex;
51
+ align-items: center;
52
+ justify-content: space-between;
53
+ border-bottom: 1px solid #e1e3eb;
54
+ background: #fafafa;
55
+ ` ;
56
+ const ChatTitle = styled . h3 `
57
+ margin: 0;
58
+ font-size: 14px;
59
+ font-weight: 500;
60
+ color: #222222;
61
+ ` ;
62
+
29
63
const preventDefault = ( e : any ) => {
30
64
e . preventDefault ( ) ;
31
65
} ;
@@ -49,6 +83,12 @@ function Bottom(props: any) {
49
83
} ;
50
84
51
85
const [ bottomHeight , setBottomHeight ] = useState ( panelStyle . bottom . h ) ;
86
+ const [ currentOption , setCurrentOption ] = useState ( "data" ) ;
87
+
88
+ const items : MenuItem [ ] = [
89
+ { key : 'data' , icon : < DatabaseOutlined /> , label : 'Data Queries' } ,
90
+ { key : 'ai' , icon : < AIGenerate /> , label : 'Lowcoder AI' } ,
91
+ ] ;
52
92
53
93
return (
54
94
< >
@@ -62,7 +102,34 @@ function Bottom(props: any) {
62
102
onResizeStart = { addListener }
63
103
onResizeStop = { resizeStop }
64
104
>
65
- < BottomContent />
105
+ < Flex style = { { height : '100%' } } >
106
+ < StyledMenu
107
+ defaultSelectedKeys = { [ currentOption ] }
108
+ mode = "inline"
109
+ inlineCollapsed = { true }
110
+ items = { items }
111
+ onSelect = { ( { key} ) => {
112
+ setCurrentOption ( key ) ;
113
+ } }
114
+ />
115
+ { currentOption === "data" && < BottomContent /> }
116
+ { currentOption === "ai" && (
117
+ < Flex style = { { height : '100%' , flex : 1 } } vertical >
118
+ < ChatHeader >
119
+ < ChatTitle > Lowcoder AI Assistant</ ChatTitle >
120
+ </ ChatHeader >
121
+ < ChatView
122
+ tableName = "LC_AI"
123
+ modelType = "n8n"
124
+ // streaming={true}
125
+ // systemPrompt="You are a helpful assistant."
126
+ // agent={true}
127
+ // maxInteractions={10}
128
+ modelHost = "http://localhost:5678/webhook-test/9a363e76-d3a5-46d1-98c3-4359f7106d33"
129
+ />
130
+ </ Flex >
131
+ ) }
132
+ </ Flex >
66
133
</ StyledResizableBox >
67
134
</ >
68
135
) ;
0 commit comments