Download src/ui/dropdown/toggle-button.tsx from SaylorTwift/openhands: direct link, hf CLI and curl.
- Browser
- Download file 747 Bytes
-
https://huggingface.co/SaylorTwift/openhands/resolve/main/src/ui/dropdown/toggle-button.tsx
- Command line
-
hf download hf://SaylorTwift/openhands/src/ui/dropdown/toggle-button.tsx
-
curl -L -o toggle-button.tsx https://huggingface.co/SaylorTwift/openhands/resolve/main/src/ui/dropdown/toggle-button.tsx
747 Bytes
| import { | |
| ComboboxCaretIcon, | |
| comboboxCaretButtonClassName, | |
| } from "#/ui/combobox-caret"; | |
| import { cn } from "#/utils/utils"; | |
| interface ToggleButtonProps { | |
| isOpen: boolean; | |
| isDisabled: boolean; | |
| getToggleButtonProps: (props?: object) => object; | |
| } | |
| export function ToggleButton({ | |
| isOpen, | |
| isDisabled, | |
| getToggleButtonProps, | |
| }: ToggleButtonProps) { | |
| return ( | |
| <button | |
| type="button" | |
| data-testid="dropdown-trigger" | |
| {...getToggleButtonProps({ | |
| disabled: isDisabled, | |
| className: cn( | |
| comboboxCaretButtonClassName, | |
| "text-current", | |
| isOpen && "rotate-180", | |
| isDisabled && "cursor-not-allowed", | |
| ), | |
| })} | |
| > | |
| <ComboboxCaretIcon /> | |
| </button> | |
| ); | |
| } | |