import { compileClassNames } from '@zohodesk/utils';
/**
 * container classname based on js state
 * @param {object} props button props
 * @param {object} style button syle
 * @returns {string} classnames string with space separate
 */

export default ((props, style) => {
  const {
    children,
    textEllipsis,
    size,
    shape,
    variant,
    color,
    active,
    hovered,
    disabled,
    cursor,
    startIcon,
    endIcon
  } = props;
  return compileClassNames({
    [style.base]: true,
    [style[size]]: !!size,
    [style[shape]]: !!shape,
    [style[variant]]: !!variant,
    [style[color]]: !!color,
    [style.ellipsis]: !!textEllipsis,
    [style[cursor]]: !!cursor,
    [style.content]: !!(startIcon || endIcon || children),
    [style.active]: !!active,
    [style.hovered]: !!hovered,
    [style.disabled]: !!disabled
  });
});