@@ -2,7 +2,14 @@ import React from "react";
2
2
import { Link } from "gatsby" ;
3
3
import { useConfigStore } from "../hooks/store" ;
4
4
import { Tooltip } from "antd" ;
5
- import { Settings , MessagesSquare } from "lucide-react" ;
5
+ import {
6
+ Settings ,
7
+ MessagesSquare ,
8
+ Blocks ,
9
+ Bot ,
10
+ PanelLeftClose ,
11
+ PanelLeftOpen ,
12
+ } from "lucide-react" ;
6
13
import Icon from "./icons" ;
7
14
8
15
interface INavItem {
@@ -23,6 +30,12 @@ const navigation: INavItem[] = [
23
30
icon : MessagesSquare ,
24
31
breadcrumbs : [ { name : "Playground" , href : "/" , current : true } ] ,
25
32
} ,
33
+ {
34
+ name : "Agent Teams" ,
35
+ href : "/build" ,
36
+ icon : Bot ,
37
+ breadcrumbs : [ { name : "Build" , href : "/build" , current : true } ] ,
38
+ } ,
26
39
] ;
27
40
28
41
const classNames = ( ...classes : ( string | undefined | boolean ) [ ] ) => {
@@ -51,9 +64,9 @@ const Sidebar = ({ link, meta, isMobile }: SidebarProps) => {
51
64
const showFull = isMobile || isExpanded ;
52
65
53
66
const handleNavClick = ( item : INavItem ) => {
54
- if ( ! isExpanded ) {
55
- setSidebarState ( { isExpanded : true } ) ;
56
- }
67
+ // if (!isExpanded) {
68
+ // setSidebarState({ isExpanded: true });
69
+ // }
57
70
setHeader ( {
58
71
title : item . name ,
59
72
breadcrumbs : item . breadcrumbs ,
@@ -126,12 +139,12 @@ const Sidebar = ({ link, meta, isMobile }: SidebarProps) => {
126
139
onClick = { ( ) => handleNavClick ( item ) }
127
140
className = { classNames (
128
141
// Base styles
129
- "group flex gap-x-3 rounded-md p-2 text-sm font-medium" ,
142
+ "group flex gap-x-3 rounded-md mr-2 p-2 text-sm font-medium" ,
130
143
! showFull && "justify-center" ,
131
144
// Color states
132
145
isActive
133
- ? "bg-secondary/50 text-accent"
134
- : "text-secondary hover:bg-secondary/50 hover:text-accent"
146
+ ? "bg-tertiary text-accent "
147
+ : "text-secondary hover:bg-tertiary hover:text-accent"
135
148
) }
136
149
>
137
150
< IconComponent
@@ -165,11 +178,53 @@ const Sidebar = ({ link, meta, isMobile }: SidebarProps) => {
165
178
< li
166
179
className = { classNames (
167
180
"mt-auto -mx-2 mb-4" ,
168
- ! showFull && "flex justify- center"
181
+ ! showFull && "flex flex-col items- center gap-1 "
169
182
) }
170
183
>
171
184
{ ! showFull && ! isMobile ? (
172
- < Tooltip title = "Settings" placement = "right" >
185
+ < >
186
+ < Tooltip title = "Settings" placement = "right" >
187
+ < Link
188
+ to = "/settings"
189
+ onClick = { ( ) =>
190
+ setHeader ( {
191
+ title : "Settings" ,
192
+ breadcrumbs : [
193
+ {
194
+ name : "Settings" ,
195
+ href : "/settings" ,
196
+ current : true ,
197
+ } ,
198
+ ] ,
199
+ } )
200
+ }
201
+ className = "group flex gap-x-3 rounded-md p-2 text-sm font-medium text-primary hover:text-accent hover:bg-secondary justify-center"
202
+ >
203
+ < Settings className = "h-6 w-6 shrink-0 text-secondary group-hover:text-accent" />
204
+ </ Link >
205
+ </ Tooltip >
206
+ < div className = "hidden md:block" >
207
+ < Tooltip
208
+ title = { isExpanded ? "Close Sidebar" : "Open Sidebar" }
209
+ placement = "right"
210
+ >
211
+ < button
212
+ onClick = { ( ) =>
213
+ setSidebarState ( { isExpanded : ! isExpanded } )
214
+ }
215
+ className = "p-2 rounded-md hover:bg-secondary hover:text-accent text-secondary transition-colors focus:outline-none focus:ring-2 focus:ring-accent focus:ring-opacity-50"
216
+ >
217
+ { isExpanded ? (
218
+ < PanelLeftClose strokeWidth = { 1.5 } className = "h-6 w-6" />
219
+ ) : (
220
+ < PanelLeftOpen strokeWidth = { 1.5 } className = "h-6 w-6" />
221
+ ) }
222
+ </ button >
223
+ </ Tooltip >
224
+ </ div >
225
+ </ >
226
+ ) : (
227
+ < div className = "flex items-center gap-2" >
173
228
< Link
174
229
to = "/settings"
175
230
onClick = { ( ) =>
@@ -180,31 +235,24 @@ const Sidebar = ({ link, meta, isMobile }: SidebarProps) => {
180
235
] ,
181
236
} )
182
237
}
183
- className = { classNames (
184
- "group flex gap-x-3 rounded-md p-2 text-sm font-medium" ,
185
- "text-primary hover:text-accent hover:bg-secondary" ,
186
- ! showFull && "justify-center"
187
- ) }
238
+ className = "group flex flex-1 gap-x-3 rounded-md p-2 text-sm font-medium text-primary hover:text-accent hover:bg-secondary"
188
239
>
189
240
< Settings className = "h-6 w-6 shrink-0 text-secondary group-hover:text-accent" />
241
+ { showFull && "Settings" }
190
242
</ Link >
191
- </ Tooltip >
192
- ) : (
193
- < Link
194
- to = "/settings"
195
- onClick = { ( ) =>
196
- setHeader ( {
197
- title : "Settings" ,
198
- breadcrumbs : [
199
- { name : "Settings" , href : "/settings" , current : true } ,
200
- ] ,
201
- } )
202
- }
203
- className = "group flex gap-x-3 rounded-md p-2 text-sm font-medium text-primary hover:text-accent hover:bg-secondary"
204
- >
205
- < Settings className = "h-6 w-6 shrink-0 text-secondary group-hover:text-accent" />
206
- { showFull && "Settings" }
207
- </ Link >
243
+ < div className = "hidden md:block" >
244
+ < button
245
+ onClick = { ( ) => setSidebarState ( { isExpanded : ! isExpanded } ) }
246
+ className = "p-2 rounded-md hover:bg-secondary hover:text-accent text-secondary transition-colors focus:outline-none focus:ring-2 focus:ring-accent focus:ring-opacity-50"
247
+ >
248
+ { isExpanded ? (
249
+ < PanelLeftClose strokeWidth = { 1.5 } className = "h-6 w-6" />
250
+ ) : (
251
+ < PanelLeftOpen strokeWidth = { 1.5 } className = "h-6 w-6" />
252
+ ) }
253
+ </ button >
254
+ </ div >
255
+ </ div >
208
256
) }
209
257
</ li >
210
258
</ ul >
0 commit comments