"use client"; import React from "react"; import Link from "next/link"; import { observer } from "mobx-react-lite"; // hooks import { useInstance } from "@/hooks"; // ui import { ToggleSwitch, getButtonStyling } from "@plane/ui"; // icons import { Settings2 } from "lucide-react"; // types import { TInstanceAuthenticationMethodKeys } from "@plane/types"; // helpers import { cn } from "helpers/common.helper"; type Props = { disabled: boolean; updateConfig: (key: TInstanceAuthenticationMethodKeys, value: string) => void; }; export const GoogleConfiguration: React.FC = observer((props) => { const { disabled, updateConfig } = props; // store const { formattedConfig } = useInstance(); // derived values const enableGoogleConfig = formattedConfig?.IS_GOOGLE_ENABLED ?? ""; const isGoogleConfigured = !!formattedConfig?.GOOGLE_CLIENT_ID && !!formattedConfig?.GOOGLE_CLIENT_SECRET; return ( <> {isGoogleConfigured ? (
Edit { Boolean(parseInt(enableGoogleConfig)) === true ? updateConfig("IS_GOOGLE_ENABLED", "0") : updateConfig("IS_GOOGLE_ENABLED", "1"); }} size="sm" disabled={disabled} />
) : ( Configure )} ); });