forked from github/plane
* chore: swap input component with plane/ui package * chore: swap textarea component with plane/ui package * chore: swap button component with plane/ui package * chore: button component revamp * fix: button type fix * chore: secondary button revamp * chore: button props updated * chore: swap loader component with plane/ui package * fix: build error fix * chore: button component refactor * chore: code refactor * chore: swap toggle switch component with plane/ui package * chore: swap spinner component with plane/ui package * chore: swap progress bar componenet with plan/ui package * chore: code refactor
30 lines
811 B
TypeScript
30 lines
811 B
TypeScript
// hooks
|
|
import useIntegrationPopup from "hooks/use-integration-popup";
|
|
// ui
|
|
import { Button } from "@plane/ui";
|
|
// types
|
|
import { IWorkspaceIntegration } from "types";
|
|
|
|
type Props = {
|
|
workspaceIntegration: false | IWorkspaceIntegration | undefined;
|
|
provider: string | undefined;
|
|
};
|
|
|
|
export const GithubAuth: React.FC<Props> = ({ workspaceIntegration, provider }) => {
|
|
const { startAuth, isConnecting } = useIntegrationPopup(provider);
|
|
|
|
return (
|
|
<div>
|
|
{workspaceIntegration && workspaceIntegration?.id ? (
|
|
<Button variant="primary" disabled>
|
|
Successfully Connected
|
|
</Button>
|
|
) : (
|
|
<Button variant="primary" onClick={startAuth} loading={isConnecting}>
|
|
{isConnecting ? "Connecting..." : "Connect"}
|
|
</Button>
|
|
)}
|
|
</div>
|
|
);
|
|
};
|