@@ -27,11 +27,9 @@ import {
2727 ChevronsRight ,
2828 Server ,
2929 ShieldCheck ,
30- Store ,
31- Lightbulb ,
3230 Key ,
33- MessageSquarePlus ,
34- Globe
31+ Globe ,
32+ Send
3533} from 'lucide-react' ;
3634import ImportBotDialog from '@/components/ImportBotDialog' ;
3735import { cn } from "@/lib/utils" ;
@@ -63,7 +61,7 @@ import {
6361 useSortable ,
6462} from '@dnd-kit/sortable' ;
6563import { CSS } from '@dnd-kit/utilities' ;
66- import ContributeDialog from '@/components/ContributeDialog ' ;
64+ import TelegramWidget from '@/components/TelegramWidget ' ;
6765import { VisuallyHidden } from '@radix-ui/react-visually-hidden' ;
6866
6967const SIDEBAR_TRANSITION = 'duration-300 ease-out' ;
@@ -232,24 +230,6 @@ const SidebarNav = ({ onLinkClick, isCollapsed, isSheetOpen }) => {
232230 const navigate = useNavigate ( ) ;
233231 const { toast } = useToast ( ) ;
234232 const [ isDragging , setIsDragging ] = useState ( false ) ;
235- const [ randomFeature , setRandomFeature ] = useState ( { text : t ( 'contribute.improve' ) , icon : < Lightbulb className = "h-4 w-4 flex-shrink-0" /> } ) ;
236- const [ isContributeModalOpen , setIsContributeModalOpen ] = useState ( false ) ;
237-
238- useEffect ( ( ) => {
239- const texts = [
240- t ( 'contribute.suggest' ) ,
241- t ( 'contribute.change' ) ,
242- t ( 'contribute.question' ) ,
243- t ( 'contribute.improve' )
244- ] ;
245- const icons = [
246- < Lightbulb key = "lightbulb" className = "h-4 w-4 flex-shrink-0" /> ,
247- < MessageSquarePlus key = "msg" className = "h-4 w-4 flex-shrink-0" />
248- ] ;
249- const randomText = texts [ Math . floor ( Math . random ( ) * texts . length ) ] ;
250- const randomIcon = icons [ Math . floor ( Math . random ( ) * icons . length ) ] ;
251- setRandomFeature ( { text : randomText , icon : randomIcon } ) ;
252- } , [ t ] ) ;
253233
254234 const activeBotId = location . pathname . match ( / \/ b o t s \/ ( \d + ) / ) ?. [ 1 ] ;
255235
@@ -416,52 +396,13 @@ const SidebarNav = ({ onLinkClick, isCollapsed, isSheetOpen }) => {
416396 </ NavLink >
417397 ) }
418398
419- < NavLink to = "/graph-store" onClick = { onLinkClick } className = { navLinkClasses } >
420- { iconAndText ( < Store className = "h-4 w-4 flex-shrink-0" /> , t ( 'graphStore' ) ) }
421- </ NavLink >
422-
423- < NavLink to = "/api-keys" onClick = { onLinkClick } className = { navLinkClasses } >
424- { iconAndText ( < Key className = "h-4 w-4 flex-shrink-0" /> , t ( 'apiKeys' ) ) }
425- </ NavLink >
426-
427399 { hasPermission ( 'bot:update' ) && (
428400 < NavLink to = "/proxy-config" onClick = { onLinkClick } className = { navLinkClasses } >
429401 { iconAndText ( < Globe className = "h-4 w-4 flex-shrink-0" /> , t ( 'proxy' ) ) }
430402 </ NavLink >
431403 ) }
432404
433- < Dialog open = { isContributeModalOpen } onOpenChange = { setIsContributeModalOpen } >
434- < DialogTrigger asChild >
435- < Button
436- variant = "ghost"
437- className = { cn (
438- "w-full justify-start flex items-center gap-3 rounded-lg px-3 py-2 text-sm font-medium transition-colors duration-200 text-muted-foreground hover:text-foreground hover:bg-muted/50" ,
439- isCollapsed && "mx-auto h-9 w-9 justify-center gap-0 px-0"
440- ) }
441- onClick = { ( ) => {
442- setIsContributeModalOpen ( true ) ;
443- if ( typeof onLinkClick === 'function' ) onLinkClick ( ) ;
444- } }
445- >
446- { iconAndText ( randomFeature . icon , randomFeature . text ) }
447- </ Button >
448- </ DialogTrigger >
449- < ContributeDialog onClose = { ( ) => setIsContributeModalOpen ( false ) } />
450- </ Dialog >
451-
452- < Button
453- variant = "ghost"
454- className = { cn (
455- "w-full justify-start flex items-center gap-3 rounded-md px-3 py-2 text-sm font-medium transition-colors duration-200 text-muted-foreground hover:text-foreground hover:bg-accent" ,
456- isCollapsed && "mx-auto h-9 w-9 justify-center gap-0 px-0"
457- ) }
458- onClick = { async ( ) => {
459- onLinkClick ( ) ;
460- await useAppStore . getState ( ) . openChangelogDialog ( ) ;
461- } }
462- >
463- { iconAndText ( < Github className = "h-4 w-4 flex-shrink-0" /> , t ( 'changelog' ) ) }
464- </ Button >
405+ < TelegramWidget isCollapsed = { isCollapsed } />
465406
466407 < Separator className = "my-2" />
467408
@@ -703,6 +644,22 @@ export default function Layout() {
703644 < span className = { sidebarLabelClasses ( isCollapsed ) } > { t ( 'admin' ) } </ span >
704645 </ NavLink >
705646 ) }
647+ { hasPermission ( 'api_key:list' ) && (
648+ < NavLink
649+ to = "/api-keys"
650+ onClick = { ( ) => setIsSheetOpen ( false ) }
651+ className = { ( { isActive } ) => cn (
652+ "relative flex items-center gap-2.5 rounded-md px-3 py-2 text-sm font-medium transition-[background-color,color,gap,padding] " + SIDEBAR_TRANSITION ,
653+ isActive
654+ ? "bg-primary/10 text-primary before:absolute before:left-0 before:top-1 before:bottom-1 before:w-0.5 before:bg-primary before:rounded-r"
655+ : "text-muted-foreground hover:text-foreground hover:bg-accent" ,
656+ isCollapsed && "mx-auto h-9 w-9 justify-center gap-0 px-0"
657+ ) }
658+ >
659+ < Key className = "h-4 w-4 flex-shrink-0" />
660+ < span className = { sidebarLabelClasses ( isCollapsed ) } > { t ( 'apiKeys' ) } </ span >
661+ </ NavLink >
662+ ) }
706663 { hasPermission ( 'server:list' ) && (
707664 < NavLink
708665 to = "/servers"
0 commit comments