@@ -24,8 +24,7 @@ export type IDEProps = PropsWithChildren<{
2424} >
2525
2626export default function IDE ( { children, className } : IDEProps ) {
27- const { databaseId } = useWorkspace ( )
28- const [ tab , setTab ] = useState < TabValue > ( 'diagram' )
27+ const { databaseId, tab, setTab } = useWorkspace ( )
2928
3029 const isSmallBreakpoint = useBreakpoint ( 'lg' )
3130 const { data : messages } = useMessagesQuery ( databaseId )
@@ -36,7 +35,7 @@ export default function IDE({ children, className }: IDEProps) {
3635 } else {
3736 setTab ( 'diagram' )
3837 }
39- } , [ isSmallBreakpoint ] )
38+ } , [ isSmallBreakpoint , setTab ] )
4039
4140 const { value : migrationStatements } = useAsyncMemo ( async ( ) => {
4241 const sqlExecutions =
@@ -106,35 +105,32 @@ export default function IDE({ children, className }: IDEProps) {
106105 value = "chat"
107106 className = { cn (
108107 buttonVariants ( { variant : tab === 'chat' ? 'default' : 'ghost' } ) ,
109- tab === 'chat' && '!shadow-sm' ,
110108 'gap-2'
111109 ) }
112110 >
113- < MessageSquareMore size = { 14 } />
114- < span className = "hidden sm:inline" > Chat</ span >
111+ < MessageSquareMore className = "hidden sm:block" size = { 18 } />
112+ < span > Chat</ span >
115113 </ TabsTrigger >
116114 ) }
117115 < TabsTrigger
118116 value = "diagram"
119117 className = { cn (
120118 buttonVariants ( { variant : tab === 'diagram' ? 'default' : 'ghost' } ) ,
121- tab === 'diagram' && '!shadow-sm' ,
122119 'gap-2'
123120 ) }
124121 >
125- < Workflow size = { 14 } />
126- < span className = "hidden sm:inline" > Diagram</ span >
122+ < Workflow className = "hidden sm:block" size = { 18 } />
123+ < span > Diagram</ span >
127124 </ TabsTrigger >
128125 < TabsTrigger
129126 value = "migrations"
130127 className = { cn (
131128 buttonVariants ( { variant : tab === 'migrations' ? 'default' : 'ghost' } ) ,
132- tab === 'migrations' && '!shadow-sm' ,
133129 'gap-2'
134130 ) }
135131 >
136- < FileCode size = { 14 } />
137- < span className = "hidden sm:inline" > Migrations</ span >
132+ < FileCode className = "hidden sm:block" size = { 18 } />
133+ < span > Migrations</ span >
138134 </ TabsTrigger >
139135 { /* Temporarily hide seeds until we get pg_dump working */ }
140136 { /* {false && (
@@ -166,7 +162,7 @@ export default function IDE({ children, className }: IDEProps) {
166162 < TabsContent value = "migrations" className = "h-full" >
167163 < div className = "h-full flex flex-col gap-3" >
168164 < Editor
169- className = " py-4 rounded-md bg-[#1e1e1e]"
165+ className = "py-4 rounded-md bg-[#1e1e1e]"
170166 language = "pgsql"
171167 value = { migrationsSql }
172168 theme = "vs-dark"
@@ -176,6 +172,7 @@ export default function IDE({ children, className }: IDEProps) {
176172 enabled : false ,
177173 } ,
178174 fontSize : 13 ,
175+ wordWrap : 'on' ,
179176 readOnly : true ,
180177 } }
181178 onMount = { async ( editor , monaco ) => {
0 commit comments