Rohit Malhotra edc95141f7
Implement branch pagination for repository selection and improve UI async dropdown behaviour (#10588)
Co-authored-by: openhands <openhands@all-hands.dev>
Co-authored-by: amanape <83104063+amanape@users.noreply.github.com>
2025-08-29 03:38:42 +00:00

46 lines
1.0 KiB
TypeScript

import React from "react";
import { cn } from "#/utils/utils";
interface ToggleButtonProps {
isOpen: boolean;
disabled: boolean;
getToggleButtonProps: (
props?: Record<string, unknown>,
) => Record<string, unknown>;
}
export function ToggleButton({
isOpen,
disabled,
getToggleButtonProps,
}: ToggleButtonProps) {
return (
<button
// eslint-disable-next-line react/jsx-props-no-spreading
{...getToggleButtonProps({
disabled,
className: cn(
"p-1 text-[#B7BDC2] hover:text-[#ECEDEE]",
"disabled:cursor-not-allowed disabled:opacity-60",
),
})}
type="button"
aria-label="Toggle menu"
>
<svg
className={cn("w-4 h-4 transition-transform", isOpen && "rotate-180")}
fill="none"
stroke="currentColor"
viewBox="0 0 24 24"
>
<path
strokeLinecap="round"
strokeLinejoin="round"
strokeWidth={2}
d="M19 9l-7 7-7-7"
/>
</svg>
</button>
);
}