| 1 | import { ToolTip } from "../gui/Tooltip"; |
| 2 | |
| 3 | interface TabButtonProps { |
| 4 | label: string; |
| 5 | icon: React.ReactNode; |
| 6 | isActive: boolean; |
| 7 | onClick: () => void; |
| 8 | tabId?: string; |
| 9 | } |
| 10 | |
| 11 | export function TabButton({ |
| 12 | label, |
| 13 | icon, |
| 14 | isActive, |
| 15 | onClick, |
| 16 | tabId, |
| 17 | }: TabButtonProps) { |
| 18 | return ( |
| 19 | <ToolTip content={label} place="right" className="text-xs md:!hidden"> |
| 20 | <div |
| 21 | className={`flex cursor-pointer items-center justify-center gap-1.5 rounded-md hover:brightness-125 md:justify-start ${ |
| 22 | isActive |
| 23 | ? "bg-vsc-input-background px-2 py-2" |
| 24 | : "text-description px-2 py-2" |
| 25 | }`} |
| 26 | onClick={onClick} |
| 27 | data-testid={tabId ? `tab-${tabId}` : undefined} |
| 28 | > |
| 29 | {icon} |
| 30 | <span className="text-description hidden md:inline">{label}</span> |
| 31 | </div> |
| 32 | </ToolTip> |
| 33 | ); |
| 34 | } |