openhands / src /components /features /chat /git-control-bar-tooltip-wrapper.tsx
SaylorTwift's picture
SaylorTwift HF Staff
Add files using upload-large-folder tool
9b906ea verified
Raw
History Blame Contribute Delete
703 Bytes
import { StyledTooltip } from "#/components/shared/buttons/styled-tooltip";
interface GitControlBarTooltipWrapperProps {
tooltipMessage: string;
testId: string;
children: React.ReactNode;
shouldShowTooltip: boolean;
}
export function GitControlBarTooltipWrapper({
children,
tooltipMessage,
testId,
shouldShowTooltip,
}: GitControlBarTooltipWrapperProps) {
if (!shouldShowTooltip) {
return children;
}
return (
<StyledTooltip
content={tooltipMessage}
placement="top"
showArrow
tooltipClassName="bg-white text-black"
>
<span data-testid={testId} className="hover:opacity-100">
{children}
</span>
</StyledTooltip>
);
}