MCPcopy Create free account
hub / github.com/bytebase/dbhub / GutterSourceItem

Function GutterSourceItem

frontend/src/components/Gutter/GutterSourceItem.tsx:11–46  ·  view source on GitHub ↗
({ source }: GutterSourceItemProps)

Source from the content-addressed store, hash-verified

9}
10
11export default function GutterSourceItem({ source }: GutterSourceItemProps) {
12 const { sourceId } = useParams<{ sourceId: string }>();
13 const isActive = sourceId === source.id;
14
15 return (
16 <Tooltip>
17 <TooltipTrigger
18 render={
19 <Link
20 to={`/source/${source.id}`}
21 aria-label={source.id}
22 className={cn(
23 'w-full rounded-l-lg p-2 mt-1 flex flex-col items-center justify-center transition-colors',
24 isActive && 'bg-accent shadow'
25 )}
26 >
27 <img
28 src={DB_LOGOS[source.type]}
29 alt={`${source.type} logo`}
30 className="w-7 h-7"
31 />
32 <span className={cn(
33 'text-[10px] w-full text-center mt-1 leading-tight break-words line-clamp-2',
34 isActive ? 'text-foreground' : 'text-muted-foreground'
35 )}>
36 {source.id}
37 </span>
38 </Link>
39 }
40 />
41 <TooltipPopup side="right" sideOffset={8}>
42 {source.id}
43 </TooltipPopup>
44 </Tooltip>
45 );
46}

Callers

nothing calls this directly

Calls 1

cnFunction · 0.90

Tested by

no test coverage detected