| 9 | } |
| 10 | |
| 11 | export 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 | } |