@@ -15,11 +15,11 @@ import { EnumSize, EnumVariant } from '~/types/enum'
1515import { Link , Outlet , useLocation , useNavigate } from 'react-router-dom'
1616import { EnumRoutes } from '~/routes'
1717import { useStoreFileTree } from '@context/fileTree'
18- import { Divider } from '@components/divider/Divider'
18+ import IDEProvider , { EnumErrorKey , useIDE } from './context'
19+ import { type Model } from '@api/client'
1920import { Button } from '@components/button/Button'
21+ import { Divider } from '@components/divider/Divider'
2022import Container from '@components/container/Container'
21- import { EnumErrorKey , useIDE } from './context'
22- import { type Model } from '@api/client'
2323
2424const ReportErrors = lazy (
2525 async ( ) => await import ( '../../components/report/ReportErrors' ) ,
@@ -114,35 +114,39 @@ export default function PageIDE(): JSX.Element {
114114
115115 return (
116116 < Container . Page >
117- < PlanSidebar />
118- < div className = "w-full flex justify-between items-center min-h-[2rem] z-50" >
119- < div className = "px-3 flex items-center whitespace-nowrap" >
120- < h3 className = "font-bold text-primary-500" >
121- < span className = "inline-block" > /</ span >
122- { project ?. name }
123- </ h3 >
124- < ArrowLongRightIcon className = "w-8 mx-4 text-neutral-50" />
125- < Button
126- size = { EnumSize . sm }
127- variant = { EnumVariant . Neutral }
128- >
129- { isActivePageEditor ? (
130- < Link to = { EnumRoutes . IdeDocs } > Docs</ Link >
131- ) : (
132- < Link to = { EnumRoutes . IdeEditor } > Editor</ Link >
133- ) }
134- </ Button >
135- </ div >
136- < div className = "px-3 flex items-center min-w-[10rem] justify-end" >
137- < RunPlan />
138- < Suspense >
139- { activePlan != null && < ActivePlan plan = { activePlan } /> }
140- </ Suspense >
141- < ReportErrors />
117+ < IDEProvider >
118+ < PlanSidebar />
119+ < div className = "w-full flex justify-between items-center min-h-[2rem] z-50" >
120+ < div className = "px-3 flex items-center whitespace-nowrap" >
121+ < h3 className = "font-bold text-primary-500" >
122+ < span className = "inline-block" > /</ span >
123+ { project ?. name }
124+ </ h3 >
125+ < ArrowLongRightIcon className = "w-8 mx-4 text-neutral-50" />
126+ < Button
127+ size = { EnumSize . sm }
128+ variant = { EnumVariant . Neutral }
129+ >
130+ { isActivePageEditor ? (
131+ < Link to = { EnumRoutes . IdeDocs } > Docs</ Link >
132+ ) : (
133+ < Link to = { EnumRoutes . IdeEditor } > Editor</ Link >
134+ ) }
135+ </ Button >
136+ </ div >
137+ { isActivePageEditor && (
138+ < div className = "px-3 flex items-center min-w-[10rem] justify-end" >
139+ < RunPlan />
140+ < Suspense >
141+ { activePlan != null && < ActivePlan plan = { activePlan } /> }
142+ </ Suspense >
143+ < ReportErrors />
144+ </ div >
145+ ) }
142146 </ div >
143- </ div >
144- < Divider />
145- < Outlet / >
147+ < Divider / >
148+ < Outlet />
149+ </ IDEProvider >
146150 </ Container . Page >
147151 )
148152}
0 commit comments