@@ -4,6 +4,11 @@ import {
4
4
Heading ,
5
5
HStack ,
6
6
Link ,
7
+ Tab ,
8
+ TabList ,
9
+ TabPanel ,
10
+ TabPanels ,
11
+ Tabs ,
7
12
Text ,
8
13
useDisclosure ,
9
14
useToast ,
@@ -23,6 +28,7 @@ import { useState } from "react"
23
28
import superjson from "superjson"
24
29
import { makeToast } from "utils"
25
30
import Editor from "@monaco-editor/react"
31
+ import { SectionHeader } from "components/utils/Card"
26
32
27
33
export const getServerSideProps : GetServerSideProps = async context => {
28
34
const apiKeys = await getKeys ( )
@@ -119,84 +125,93 @@ const Settings = ({ keys: _keysString, metloConfig }) => {
119
125
currentTab = { SideNavLinkDestination . Settings }
120
126
>
121
127
< ContentContainer maxContentW = "100rem" px = "8" py = "8" >
122
- < VStack h = "full" w = "full" spacing = "8" >
123
- < Box w = "full" >
124
- < Heading fontWeight = "medium" size = "lg" mb = "4" >
125
- API Keys
126
- </ Heading >
127
- < VStack
128
- w = "full"
129
- alignItems = "flex-start"
130
- borderWidth = "1px"
131
- rounded = "md"
132
- spacing = "0"
133
- overflow = "hidden"
134
- >
135
- < Box p = "4" borderBottom = "1px" borderColor = "inherit" w = "full" >
136
- < HStack justifyContent = "space-between" >
137
- < Box />
138
- < Button colorScheme = "blue" onClick = { onOpen } >
139
- New
128
+ < VStack h = "full" w = "full" alignItems = "flex-start" spacing = "0" >
129
+ < Heading fontWeight = "medium" size = "lg" mb = "4" >
130
+ Settings
131
+ </ Heading >
132
+ < Tabs w = "full" display = "flex" flexDir = "column" flexGrow = "1" >
133
+ < TabList >
134
+ < Tab >
135
+ < SectionHeader text = "API Keys" />
136
+ </ Tab >
137
+ < Tab >
138
+ < SectionHeader text = "Metlo Config" />
139
+ </ Tab >
140
+ </ TabList >
141
+ < TabPanels flexGrow = "1" h = "full" >
142
+ < TabPanel px = "0" overflow = "auto" h = "full" >
143
+ < VStack
144
+ w = "full"
145
+ alignItems = "flex-start"
146
+ borderWidth = "1px"
147
+ rounded = "md"
148
+ spacing = "0"
149
+ overflow = "hidden"
150
+ >
151
+ < Box p = "4" borderBottom = "1px" borderColor = "inherit" w = "full" >
152
+ < HStack justifyContent = "space-between" >
153
+ < Box />
154
+ < Button colorScheme = "blue" onClick = { onOpen } >
155
+ New
156
+ </ Button >
157
+ < NewKeys
158
+ isOpen = { isOpen }
159
+ onClose = { onClose }
160
+ onCreate = { addKey }
161
+ isAddingKey = { isAddingKey }
162
+ />
163
+ < KeyAddedModal
164
+ newKey = { newKey }
165
+ newKeyName = { newKeyName }
166
+ isOpen = { isNewKeyOpen }
167
+ onClose = { onNewKeyClose }
168
+ />
169
+ </ HStack >
170
+ </ Box >
171
+ < Box w = "full" >
172
+ < ListKeys keys = { keys } setKeys = { setKeys } />
173
+ </ Box >
174
+ </ VStack >
175
+ </ TabPanel >
176
+ < TabPanel px = "0" overflow = "auto" h = "full" >
177
+ < HStack w = "full" justifyContent = "space-between" pb = "15px" >
178
+ < Text >
179
+ View our{ " " }
180
+ < Link
181
+ target = "_blank"
182
+ color = "blue"
183
+ href = "https://docs.metlo.com/docs/metlo-config"
184
+ >
185
+ docs
186
+ </ Link > { " " }
187
+ on how to set up a metlo config.
188
+ </ Text >
189
+ < Button
190
+ colorScheme = "blue"
191
+ onClick = { ( ) => updateMetloConfigHandler ( ) }
192
+ isLoading = { updatingMetloConfig }
193
+ >
194
+ Save
140
195
</ Button >
141
- < NewKeys
142
- isOpen = { isOpen }
143
- onClose = { onClose }
144
- onCreate = { addKey }
145
- isAddingKey = { isAddingKey }
146
- />
147
- < KeyAddedModal
148
- newKey = { newKey }
149
- newKeyName = { newKeyName }
150
- isOpen = { isNewKeyOpen }
151
- onClose = { onNewKeyClose }
152
- />
153
196
</ HStack >
154
- </ Box >
155
- < Box w = "full" >
156
- < ListKeys keys = { keys } setKeys = { setKeys } />
157
- </ Box >
158
- </ VStack >
159
- </ Box >
160
- < Box h = "full" w = "full" >
161
- < HStack w = "full" justifyContent = "space-between" >
162
- < Heading fontWeight = "medium" size = "lg" mb = "4" >
163
- Metlo Config
164
- </ Heading >
165
- < Button
166
- colorScheme = "blue"
167
- onClick = { ( ) => updateMetloConfigHandler ( ) }
168
- isLoading = { updatingMetloConfig }
169
- >
170
- Save
171
- </ Button >
172
- </ HStack >
173
- < Text pt = "5px" pb = "15px" >
174
- View our{ " " }
175
- < Link
176
- target = "_blank"
177
- color = "blue"
178
- href = "https://docs.metlo.com/docs/metlo-config"
179
- >
180
- docs
181
- </ Link > { " " }
182
- on how to set up a metlo config.
183
- </ Text >
184
- < Box pt = "2" rounded = "md" h = "700px" w = "full" borderWidth = "1px" >
185
- < Editor
186
- width = "100%"
187
- defaultLanguage = "yaml"
188
- value = { configString }
189
- onChange = { val => setConfigString ( val ) }
190
- options = { {
191
- minimap : {
192
- enabled : false ,
193
- } ,
194
- automaticLayout : true ,
195
- scrollBeyondLastLine : false ,
196
- } }
197
- />
198
- </ Box >
199
- </ Box >
197
+ < Box pt = "2" rounded = "md" h = "700px" w = "full" borderWidth = "1px" >
198
+ < Editor
199
+ width = "100%"
200
+ defaultLanguage = "yaml"
201
+ value = { configString }
202
+ onChange = { val => setConfigString ( val ) }
203
+ options = { {
204
+ minimap : {
205
+ enabled : false ,
206
+ } ,
207
+ automaticLayout : true ,
208
+ scrollBeyondLastLine : false ,
209
+ } }
210
+ />
211
+ </ Box >
212
+ </ TabPanel >
213
+ </ TabPanels >
214
+ </ Tabs >
200
215
</ VStack >
201
216
</ ContentContainer >
202
217
</ SidebarLayoutShell >
0 commit comments