@@ -24,6 +24,7 @@ import {
24
24
ACTION_ERROR_OVERLAY_OPEN ,
25
25
} from '../shared'
26
26
import GearIcon from '../icons/gear-icon'
27
+ import { LoadingIcon } from '../icons/loading-icon'
27
28
import { UserPreferencesBody } from '../components/errors/dev-tools-indicator/dev-tools-info/user-preferences'
28
29
import { useShortcuts } from '../hooks/use-shortcuts'
29
30
import { useUpdateAllPanelPositions } from '../components/devtools-indicator/devtools-indicator'
@@ -60,17 +61,26 @@ const MenuPanel = () => {
60
61
}
61
62
} ,
62
63
} ,
63
- {
64
- title : `Current route is ${ state . staticIndicator ? 'static' : 'dynamic' } .` ,
65
- label : 'Route' ,
66
- value : state . staticIndicator ? 'Static' : 'Dynamic' ,
67
- onClick : ( ) => setPanel ( 'route-type' ) ,
68
- attributes : {
69
- 'data-nextjs-route-type' : state . staticIndicator
70
- ? 'static'
71
- : 'dynamic' ,
72
- } ,
73
- } ,
64
+ state . staticIndicator === 'disabled'
65
+ ? undefined
66
+ : state . staticIndicator === 'pending'
67
+ ? {
68
+ title : 'Loading...' ,
69
+ label : 'Route' ,
70
+ value : < LoadingIcon /> ,
71
+ }
72
+ : {
73
+ title : `Current route is ${ state . staticIndicator ? 'static' : 'dynamic' } .` ,
74
+ label : 'Route' ,
75
+ value :
76
+ state . staticIndicator === 'static' ? 'Static' : 'Dynamic' ,
77
+ onClick : ( ) => setPanel ( 'route-type' ) ,
78
+ attributes : {
79
+ 'data-nextjs-route-type' : state . staticIndicator
80
+ ? 'static'
81
+ : 'dynamic' ,
82
+ } ,
83
+ } ,
74
84
! ! process . env . TURBOPACK
75
85
? {
76
86
title : 'Turbopack is enabled.' ,
@@ -166,39 +176,39 @@ export const PanelRouter = () => {
166
176
</ DynamicPanel >
167
177
</ PanelRoute >
168
178
169
- < PanelRoute name = "route-type" >
170
- < DynamicPanel
171
- key = { state . staticIndicator ? 'static' : 'dynamic' }
172
- sharePanelSizeGlobally = { false }
173
- sizeConfig = { {
174
- kind : 'fixed' ,
175
- height : state . staticIndicator
176
- ? 300 / state . scale
177
- : 325 / state . scale ,
178
- width : 400 / state . scale ,
179
- } }
180
- closeOnClickOutside
181
- header = {
182
- < DevToolsHeader
183
- title = { `${ state . staticIndicator ? 'Static' : 'Dynamic' } Route` }
184
- />
185
- }
186
- >
187
- < div className = "panel-content" >
188
- < RouteInfoBody
189
- routerType = { state . routerType }
190
- isStaticRoute = { state . staticIndicator }
191
- />
192
- < InfoFooter
193
- href = {
194
- learnMoreLink [ state . routerType ] [
195
- state . staticIndicator ? 'static' : 'dynamic'
196
- ]
179
+ { state . staticIndicator !== 'disabled' &&
180
+ state . staticIndicator !== 'pending' && (
181
+ < PanelRoute name = "route-type" >
182
+ < DynamicPanel
183
+ key = { state . staticIndicator }
184
+ sharePanelSizeGlobally = { false }
185
+ sizeConfig = { {
186
+ kind : 'fixed' ,
187
+ height :
188
+ state . staticIndicator === 'static'
189
+ ? 300 / state . scale
190
+ : 325 / state . scale ,
191
+ width : 400 / state . scale ,
192
+ } }
193
+ closeOnClickOutside
194
+ header = {
195
+ < DevToolsHeader
196
+ title = { `${ state . staticIndicator ? 'Static' : 'Dynamic' } Route` }
197
+ />
197
198
}
198
- />
199
- </ div >
200
- </ DynamicPanel >
201
- </ PanelRoute >
199
+ >
200
+ < div className = "panel-content" >
201
+ < RouteInfoBody
202
+ routerType = { state . routerType }
203
+ isStaticRoute = { state . staticIndicator === 'static' }
204
+ />
205
+ < InfoFooter
206
+ href = { learnMoreLink [ state . routerType ] [ state . staticIndicator ] }
207
+ />
208
+ </ div >
209
+ </ DynamicPanel >
210
+ </ PanelRoute >
211
+ ) }
202
212
203
213
{ isAppRouter && (
204
214
< PanelRoute name = "segment-explorer" >
0 commit comments