/** * Copyright (c) 2023-present Plane Software, Inc. and contributors * SPDX-License-Identifier: AGPL-3.0-only * See the LICENSE file for details. */ import * as React from "react"; import { cn } from "../utils"; import { OAuthButton } from "./oauth-button"; export type TOAuthOption = { id: string; text: string; icon: React.ReactNode; onClick: () => void; enabled?: boolean; }; type OAuthOptionsProps = { options: TOAuthOption[]; compact?: boolean; showDivider?: boolean; dividerLabel?: string; className?: string; containerClassName?: string; }; export function OAuthOptions(props: OAuthOptionsProps) { const { options, compact = false, showDivider = true, dividerLabel = "or", className = "", containerClassName = "", } = props; // Filter enabled options const enabledOptions = options.filter((option) => option.enabled !== false); if (enabledOptions.length === 0) return null; return (
{enabledOptions.map((option) => ( ))}
{showDivider && (

{dividerLabel}


)}
); }