OpenHands/frontend/src/components/features/settings/git-settings/configure-azure-devops-anchor.tsx
Wan Arif 3504ca7752
feat: add Azure DevOps integration support (#11243)
Co-authored-by: Graham Neubig <neubig@gmail.com>
2025-11-22 14:00:24 -05:00

38 lines
937 B
TypeScript

import { useTranslation } from "react-i18next";
import { I18nKey } from "#/i18n/declaration";
import { useConfig } from "#/hooks/query/use-config";
import { useAuthUrl } from "#/hooks/use-auth-url";
import { BrandButton } from "../brand-button";
export function ConfigureAzureDevOpsAnchor() {
const { t } = useTranslation();
const { data: config } = useConfig();
const authUrl = useAuthUrl({
appMode: config?.APP_MODE ?? null,
identityProvider: "azure_devops",
authUrl: config?.AUTH_URL,
});
const handleOAuthFlow = () => {
if (!authUrl) {
return;
}
window.location.href = authUrl;
};
return (
<div data-testid="configure-azure-devops-button" className="py-9">
<BrandButton
type="button"
variant="primary"
className="w-55"
onClick={handleOAuthFlow}
>
{t(I18nKey.AZURE_DEVOPS$CONNECT_ACCOUNT)}
</BrandButton>
</div>
);
}