@@ -24,8 +24,7 @@ export type IDEProps = PropsWithChildren<{
24
24
} >
25
25
26
26
export default function IDE ( { children, className } : IDEProps ) {
27
- const { databaseId } = useWorkspace ( )
28
- const [ tab , setTab ] = useState < TabValue > ( 'diagram' )
27
+ const { databaseId, tab, setTab } = useWorkspace ( )
29
28
30
29
const isSmallBreakpoint = useBreakpoint ( 'lg' )
31
30
const { data : messages } = useMessagesQuery ( databaseId )
@@ -36,7 +35,7 @@ export default function IDE({ children, className }: IDEProps) {
36
35
} else {
37
36
setTab ( 'diagram' )
38
37
}
39
- } , [ isSmallBreakpoint ] )
38
+ } , [ isSmallBreakpoint , setTab ] )
40
39
41
40
const { value : migrationStatements } = useAsyncMemo ( async ( ) => {
42
41
const sqlExecutions =
@@ -106,35 +105,32 @@ export default function IDE({ children, className }: IDEProps) {
106
105
value = "chat"
107
106
className = { cn (
108
107
buttonVariants ( { variant : tab === 'chat' ? 'default' : 'ghost' } ) ,
109
- tab === 'chat' && '!shadow-sm' ,
110
108
'gap-2'
111
109
) }
112
110
>
113
- < MessageSquareMore size = { 14 } />
114
- < span className = "hidden sm:inline" > Chat</ span >
111
+ < MessageSquareMore className = "hidden sm:block" size = { 18 } />
112
+ < span > Chat</ span >
115
113
</ TabsTrigger >
116
114
) }
117
115
< TabsTrigger
118
116
value = "diagram"
119
117
className = { cn (
120
118
buttonVariants ( { variant : tab === 'diagram' ? 'default' : 'ghost' } ) ,
121
- tab === 'diagram' && '!shadow-sm' ,
122
119
'gap-2'
123
120
) }
124
121
>
125
- < Workflow size = { 14 } />
126
- < span className = "hidden sm:inline" > Diagram</ span >
122
+ < Workflow className = "hidden sm:block" size = { 18 } />
123
+ < span > Diagram</ span >
127
124
</ TabsTrigger >
128
125
< TabsTrigger
129
126
value = "migrations"
130
127
className = { cn (
131
128
buttonVariants ( { variant : tab === 'migrations' ? 'default' : 'ghost' } ) ,
132
- tab === 'migrations' && '!shadow-sm' ,
133
129
'gap-2'
134
130
) }
135
131
>
136
- < FileCode size = { 14 } />
137
- < span className = "hidden sm:inline" > Migrations</ span >
132
+ < FileCode className = "hidden sm:block" size = { 18 } />
133
+ < span > Migrations</ span >
138
134
</ TabsTrigger >
139
135
{ /* Temporarily hide seeds until we get pg_dump working */ }
140
136
{ /* {false && (
@@ -166,7 +162,7 @@ export default function IDE({ children, className }: IDEProps) {
166
162
< TabsContent value = "migrations" className = "h-full" >
167
163
< div className = "h-full flex flex-col gap-3" >
168
164
< Editor
169
- className = " py-4 rounded-md bg-[#1e1e1e]"
165
+ className = "py-4 rounded-md bg-[#1e1e1e]"
170
166
language = "pgsql"
171
167
value = { migrationsSql }
172
168
theme = "vs-dark"
@@ -176,6 +172,7 @@ export default function IDE({ children, className }: IDEProps) {
176
172
enabled : false ,
177
173
} ,
178
174
fontSize : 13 ,
175
+ wordWrap : 'on' ,
179
176
readOnly : true ,
180
177
} }
181
178
onMount = { async ( editor , monaco ) => {
0 commit comments