@@ -4,6 +4,7 @@ import { Button } from "components/Button/Button";
44import { ExternalImage } from "components/ExternalImage/ExternalImage" ;
55import { CoderIcon } from "components/Icons/CoderIcon" ;
66import type { ProxyContextValue } from "contexts/ProxyContext" ;
7+ import { useAgenticChat } from "contexts/useAgenticChat" ;
78import { useWebpushNotifications } from "contexts/useWebpushNotifications" ;
89import { NotificationsInbox } from "modules/notifications/NotificationsInbox/NotificationsInbox" ;
910import type { FC } from "react" ;
@@ -45,8 +46,7 @@ export const NavbarView: FC<NavbarViewProps> = ({
4546canViewAuditLog,
4647proxyContextValue,
4748} ) => {
48- const { subscribed, enabled, loading, subscribe, unsubscribe} =
49- useWebpushNotifications ( ) ;
49+ const webPush = useWebpushNotifications ( ) ;
5050
5151return (
5252< 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> = ({
7676/>
7777</ div >
7878
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+ >
8286Disable WebPush
8387</ Button >
8488) :(
85- < Button variant = "outline" disabled = { loading } onClick = { subscribe } >
89+ < Button
90+ variant = "outline"
91+ disabled = { webPush . loading }
92+ onClick = { webPush . subscribe }
93+ >
8694Enable WebPush
8795</ Button >
8896)
@@ -132,6 +140,7 @@ interface NavItemsProps {
132140
133141const NavItems :FC < NavItemsProps > = ( { className} ) => {
134142const location = useLocation ( ) ;
143+ const agenticChat = useAgenticChat ( ) ;
135144
136145return (
137146< nav className = { cn ( "flex items-center gap-4 h-full" , className ) } >
@@ -154,14 +163,16 @@ const NavItems: FC<NavItemsProps> = ({ className }) => {
154163>
155164Templates
156165</ 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 }
165176</ nav >
166177) ;
167178} ;