Skip to main content
Glama
GutterIcon.tsx1.12 kB
import { Link, useLocation } from 'react-router-dom'; import { Tooltip, TooltipTrigger, TooltipPopup } from '@/components/ui/tooltip'; import { cn } from '../../lib/utils'; interface GutterIconProps { icon: React.ReactNode; tooltip: string; to?: string; href?: string; } export default function GutterIcon({ icon, tooltip, to, href }: GutterIconProps) { const location = useLocation(); const isActive = to ? location.pathname === to : false; const iconButton = ( <div className={cn( 'w-full h-10 rounded-l-lg p-2 flex items-center justify-center transition-colors', isActive && 'bg-accent shadow' )} > {icon} </div> ); const wrappedIcon = to ? ( <Link to={to} aria-label={tooltip}> {iconButton} </Link> ) : href ? ( <a href={href} target="_blank" rel="noopener noreferrer" aria-label={tooltip}> {iconButton} </a> ) : ( iconButton ); return ( <Tooltip> <TooltipTrigger render={wrappedIcon} /> <TooltipPopup side="right" sideOffset={8}> {tooltip} </TooltipPopup> </Tooltip> ); }

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/bytebase/dbhub'

If you have feedback or need assistance with the MCP directory API, please join our Discord server