/** * Copyright (c) 2023-present Plane Software, Inc. and contributors * SPDX-License-Identifier: AGPL-3.0-only * See the LICENSE file for details. */ import React from "react"; // helpers import { Button } from "@plane/propel/button"; import { Tooltip } from "@makeplane/propel/components/tooltip"; import { cn } from "@plane/utils"; // types import { usePlatformOS } from "@/hooks/use-platform-os"; import { BACKGROUND_BUTTON_VARIANTS, BORDER_BUTTON_VARIANTS } from "./constants"; import type { TButtonVariants } from "./types"; export type DropdownButtonProps = { children: React.ReactNode; className?: string; isActive: boolean; tooltipContent?: string; tooltipHeading: string; showTooltip: boolean; variant: TButtonVariants; renderToolTipByDefault?: boolean; }; type ButtonProps = { children: React.ReactNode; className?: string; isActive: boolean; tooltipContent?: string; tooltipHeading: string; showTooltip: boolean; renderToolTipByDefault?: boolean; }; export function DropdownButton(props: DropdownButtonProps) { const { children, className, isActive, tooltipContent, renderToolTipByDefault = true, tooltipHeading, showTooltip, variant, } = props; const ButtonToRender: React.FC = BORDER_BUTTON_VARIANTS.includes(variant) ? BorderButton : BACKGROUND_BUTTON_VARIANTS.includes(variant) ? BackgroundButton : TransparentButton; return ( {children} ); } function BorderButton(props: ButtonProps) { const { children, className, isActive, tooltipContent, tooltipHeading, showTooltip } = props; const { isMobile } = usePlatformOS(); return ( ); } function BackgroundButton(props: ButtonProps) { const { children, className, tooltipContent, tooltipHeading, showTooltip } = props; const { isMobile } = usePlatformOS(); return ( ); } function TransparentButton(props: ButtonProps) { const { children, className, isActive, tooltipContent, tooltipHeading, showTooltip } = props; const { isMobile } = usePlatformOS(); return ( ); }