mirror of
https://github.com/makeplane/plane.git
synced 2025-12-21 22:29:36 +01:00
restructring
This commit is contained in:
27
web/components/integration/github/auth.tsx
Normal file
27
web/components/integration/github/auth.tsx
Normal file
@@ -0,0 +1,27 @@
|
||||
// hooks
|
||||
import useIntegrationPopup from "hooks/use-integration-popup";
|
||||
// ui
|
||||
import { PrimaryButton } from "components/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 ? (
|
||||
<PrimaryButton disabled>Successfully Connected</PrimaryButton>
|
||||
) : (
|
||||
<PrimaryButton onClick={startAuth} loading={isConnecting}>
|
||||
{isConnecting ? "Connecting..." : "Connect"}
|
||||
</PrimaryButton>
|
||||
)}
|
||||
</div>
|
||||
);
|
||||
};
|
||||
Reference in New Issue
Block a user