// helpers import { Tooltip } from "@plane/ui"; import { cn } from "@/helpers/common.helper"; // types import { usePlatformOS } from "@/hooks/use-platform-os"; import { BACKGROUND_BUTTON_VARIANTS, BORDER_BUTTON_VARIANTS } from "./constants"; import { TButtonVariants } from "./types"; 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; const { isMobile } = usePlatformOS(); return (
{children}
); }; const BackgroundButton: React.FC = (props) => { const { children, className, tooltipContent, tooltipHeading, showTooltip } = props; const { isMobile } = usePlatformOS(); return (
{children}
); }; const TransparentButton: React.FC = (props) => { const { children, className, isActive, tooltipContent, tooltipHeading, showTooltip } = props; const { isMobile } = usePlatformOS(); return (
{children}
); };