@@ -4,6 +4,7 @@ import { Button } from "components/Button/Button";
4
4
import { ExternalImage } from "components/ExternalImage/ExternalImage" ;
5
5
import { CoderIcon } from "components/Icons/CoderIcon" ;
6
6
import type { ProxyContextValue } from "contexts/ProxyContext" ;
7
+ import { useAgenticChat } from "contexts/useAgenticChat" ;
7
8
import { useWebpushNotifications } from "contexts/useWebpushNotifications" ;
8
9
import { NotificationsInbox } from "modules/notifications/NotificationsInbox/NotificationsInbox" ;
9
10
import type { FC } from "react" ;
@@ -45,8 +46,7 @@ export const NavbarView: FC<NavbarViewProps> = ({
45
46
canViewAuditLog,
46
47
proxyContextValue,
47
48
} ) => {
48
- const { subscribed, enabled, loading, subscribe, unsubscribe} =
49
- useWebpushNotifications ( ) ;
49
+ const webPush = useWebpushNotifications ( ) ;
50
50
51
51
return (
52
52
< div className = "border-0 border-b border-solid h-[72px] flex items-center leading-none px-6" >
@@ -76,13 +76,21 @@ export const NavbarView: FC<NavbarViewProps> = ({
76
76
/>
77
77
</ div >
78
78
79
- { enabled ?(
80
- subscribed ?(
81
- < Button variant = "outline" disabled = { loading } onClick = { unsubscribe } >
79
+ { webPush . enabled ?(
80
+ webPush . subscribed ?(
81
+ < Button
82
+ variant = "outline"
83
+ disabled = { webPush . loading }
84
+ onClick = { webPush . unsubscribe }
85
+ >
82
86
Disable WebPush
83
87
</ Button >
84
88
) :(
85
- < Button variant = "outline" disabled = { loading } onClick = { subscribe } >
89
+ < Button
90
+ variant = "outline"
91
+ disabled = { webPush . loading }
92
+ onClick = { webPush . subscribe }
93
+ >
86
94
Enable WebPush
87
95
</ Button >
88
96
)
@@ -132,6 +140,7 @@ interface NavItemsProps {
132
140
133
141
const NavItems :FC < NavItemsProps > = ( { className} ) => {
134
142
const location = useLocation ( ) ;
143
+ const agenticChat = useAgenticChat ( ) ;
135
144
136
145
return (
137
146
< nav className = { cn ( "flex items-center gap-4 h-full" , className ) } >
@@ -154,14 +163,16 @@ const NavItems: FC<NavItemsProps> = ({ className }) => {
154
163
>
155
164
Templates
156
165
</ NavLink >
157
- < NavLink
158
- className = { ( { isActive} ) => {
159
- return cn ( linkStyles . default , isActive ?linkStyles . active :"" ) ;
160
- } }
161
- to = "/chat"
162
- >
163
- Chat
164
- </ NavLink >
166
+ { agenticChat . enabled ?(
167
+ < NavLink
168
+ className = { ( { isActive} ) => {
169
+ return cn ( linkStyles . default , isActive ?linkStyles . active :"" ) ;
170
+ } }
171
+ to = "/chat"
172
+ >
173
+ Chat
174
+ </ NavLink >
175
+ ) :null }
165
176
</ nav >
166
177
) ;
167
178
} ;