import { forwardRef } from "react"; import classNames from "classnames"; import { BaseButton, Props as BaseButtonProps } from "./BaseButton"; import { ButtonColor } from "./types"; import { createButtonIcon } from "./createButtonIcon"; export type Props = BaseButtonProps & { color: ButtonColor; noPadding?: boolean; }; const colorToIconColorMap = { accent: "accent", primary: "primary", success: "success", danger: "danger", warning: "warning", neutral: "neutral", subdued: "subdued" }; export const VuiButtonTertiary = forwardRef( ({ children, icon, color, size = "m", className, isSelected, isDisabled, noPadding, ...rest }: Props, ref) => { const classes = classNames(className, "vuiButtonTertiary", `vuiButtonTertiary--${color}`, { "vuiButtonTertiary-isSelected": isSelected, "vuiButtonTertiary-noPadding": noPadding }); const buttonIcon = createButtonIcon(icon, size, color, colorToIconColorMap); return ( {children} ); } );