|
118 | 118 | let isBootStrapUser = $derived(profile.current.isBootstrapUser?.() ?? false); |
119 | 119 | let isAtLeastPowerUserPlus = $derived(profile.current.groups.includes(Group.POWERUSER_PLUS)); |
120 | 120 | let isAtLeastPowerUser = $derived(profile.current.groups.includes(Group.POWERUSER)); |
| 121 | + let chatLinks = $derived<NavLink[]>([ |
| 122 | + ...(version.current.disableLegacyChat !== true |
| 123 | + ? [ |
| 124 | + { |
| 125 | + id: 'legacy-chat', |
| 126 | + href: '/chat', |
| 127 | + icon: MessageCircle, |
| 128 | + label: 'Launch Chat', |
| 129 | + disabled: isBootStrapUser, |
| 130 | + collapsible: false |
| 131 | + } |
| 132 | + ] |
| 133 | + : []), |
| 134 | + ...(version.current.nanobotIntegration |
| 135 | + ? [ |
| 136 | + { |
| 137 | + id: 'nanobot-chat', |
| 138 | + href: '/nanobot', |
| 139 | + icon: BotMessageSquare, |
| 140 | + disabled: isBootStrapUser, |
| 141 | + label: 'Launch Agent', |
| 142 | + collapsible: false |
| 143 | + } |
| 144 | + ] |
| 145 | + : []) |
| 146 | + ]); |
121 | 147 | let navLinks = $derived<NavLink[]>( |
122 | 148 | profile.current.hasAdminAccess?.() |
123 | 149 | ? [ |
|
235 | 261 | disabled: isBootStrapUser, |
236 | 262 | collapsible: false |
237 | 263 | }, |
238 | | - { |
239 | | - id: 'chat', |
240 | | - href: '/chat', |
241 | | - icon: MessageCircle, |
242 | | - label: 'Launch Chat', |
243 | | - disabled: isBootStrapUser, |
244 | | - collapsible: false |
245 | | - }, |
246 | | - ...(version.current.nanobotIntegration |
247 | | - ? [ |
248 | | - { |
249 | | - id: 'nanobot', |
250 | | - href: '/nanobot', |
251 | | - icon: BotMessageSquare, |
252 | | - disabled: isBootStrapUser, |
253 | | - label: 'Launch Nanobot', |
254 | | - collapsible: false |
255 | | - } |
256 | | - ] |
257 | | - : []) |
| 264 | + ...chatLinks |
258 | 265 | ] |
259 | 266 | }, |
260 | 267 | { |
|
362 | 369 | } |
363 | 370 | ] |
364 | 371 | }, |
365 | | - { |
366 | | - id: 'chat', |
367 | | - href: '/chat', |
368 | | - icon: MessageCircle, |
369 | | - label: 'Chat', |
370 | | - disabled: isBootStrapUser, |
371 | | - collapsible: false |
372 | | - }, |
373 | | - ...(version.current.nanobotIntegration |
374 | | - ? [ |
375 | | - { |
376 | | - id: 'nanobot', |
377 | | - href: '/nanobot', |
378 | | - icon: BotMessageSquare, |
379 | | - label: 'Launch Nanobot', |
380 | | - collapsible: false |
381 | | - } |
382 | | - ] |
383 | | - : []) |
| 372 | + ...chatLinks |
384 | 373 | ] |
385 | 374 | : [ |
386 | 375 | { |
|
391 | 380 | disabled: false, |
392 | 381 | collapsible: false |
393 | 382 | }, |
394 | | - { |
395 | | - id: 'chat', |
396 | | - href: '/chat', |
397 | | - icon: MessageCircle, |
398 | | - label: 'Chat', |
399 | | - disabled: isBootStrapUser, |
400 | | - collapsible: false |
401 | | - } |
| 383 | + ...chatLinks |
402 | 384 | ] |
403 | 385 | ); |
404 | 386 |
|
|
0 commit comments