Download src/components/features/context-menu/context-menu-icon-text.tsx from SaylorTwift/openhands: direct link, hf CLI and curl.
- Browser
- Download file 1.01 kB
-
https://huggingface.co/SaylorTwift/openhands/resolve/main/src/components/features/context-menu/context-menu-icon-text.tsx
- Command line
-
hf download hf://SaylorTwift/openhands/src/components/features/context-menu/context-menu-icon-text.tsx
-
curl -L -o context-menu-icon-text.tsx https://huggingface.co/SaylorTwift/openhands/resolve/main/src/components/features/context-menu/context-menu-icon-text.tsx
1.01 kB
| import { cn } from "#/utils/utils"; | |
| import { | |
| dropdownMenuRowGapClassName, | |
| dropdownMenuRowIconWrapperClassName, | |
| } from "#/utils/dropdown-classes"; | |
| import CheckIcon from "#/icons/checkmark.svg?react"; | |
| interface ContextMenuIconTextProps { | |
| icon: React.ComponentType<{ className?: string }>; | |
| text: string; | |
| className?: string; | |
| iconClassName?: string; | |
| isActive?: boolean; | |
| } | |
| export function ContextMenuIconText({ | |
| icon: Icon, | |
| text, | |
| className, | |
| iconClassName, | |
| isActive = false, | |
| }: ContextMenuIconTextProps) { | |
| return ( | |
| <div | |
| className={cn( | |
| "flex min-w-0 items-center", | |
| dropdownMenuRowGapClassName, | |
| className, | |
| )} | |
| > | |
| <Icon | |
| className={cn( | |
| "h-4 w-4", | |
| dropdownMenuRowIconWrapperClassName, | |
| iconClassName, | |
| )} | |
| /> | |
| <span className="min-w-0 flex-1 leading-5">{text}</span> | |
| {isActive && ( | |
| <CheckIcon width={14} height={14} className="shrink-0" aria-hidden /> | |
| )} | |
| </div> | |
| ); | |
| } | |