plane/web/components/integration/github/auth.tsx
Anmol Singh Bhatia 35a7d10b8f
chore: plane ui library component and code refactor (#2406)
* 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
2023-10-11 16:48:58 +05:30

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>
);
};