// helpers import { Tooltip } from "@plane/ui"; import { cn } from "helpers/common.helper"; // types import { BACKGROUND_BUTTON_VARIANTS, BORDER_BUTTON_VARIANTS } from "./constants"; import { TButtonVariants } from "./types"; // constants export type DropdownButtonProps = { children: React.ReactNode; className?: string; isActive: boolean; tooltipContent: string | React.ReactNode; tooltipHeading: string; showTooltip: boolean; variant: TButtonVariants; }; type ButtonProps = { children: React.ReactNode; className?: string; isActive: boolean; tooltipContent: string | React.ReactNode; tooltipHeading: string; showTooltip: boolean; }; export const DropdownButton: React.FC = (props) => { const { children, className, isActive, tooltipContent, tooltipHeading, showTooltip, variant } = props; const ButtonToRender: React.FC = BORDER_BUTTON_VARIANTS.includes(variant) ? BorderButton : BACKGROUND_BUTTON_VARIANTS.includes(variant) ? BackgroundButton : TransparentButton; return ( {children} ); }; const BorderButton: React.FC = (props) => { const { children, className, isActive, tooltipContent, tooltipHeading, showTooltip } = props; return (
{children}
); }; const BackgroundButton: React.FC = (props) => { const { children, className, tooltipContent, tooltipHeading, showTooltip } = props; return (
{children}
); }; const TransparentButton: React.FC = (props) => { const { children, className, isActive, tooltipContent, tooltipHeading, showTooltip } = props; return (
{children}
); };