import { FC } from 'react';

import { TablerIcon } from '@material-hu/icons/tabler';

import HuTooltip from '@material-hu/components/design-system/Tooltip';

import Control, { CallButtonVariant } from './Control';

export type ButtonProps = {
  disabled?: boolean;
  onClick?: () => void;
  text: string;
  Icon: TablerIcon;
  variant?: CallButtonVariant;
};

const Button: FC<ButtonProps> = ({
  disabled = false,
  onClick,
  text,
  variant,
  Icon,
}) => {
  return (
    <Control
      disabled={disabled}
      onClick={onClick}
      callButtonVariant={variant}
    >
      <HuTooltip description={text}>
        <Icon />
      </HuTooltip>
    </Control>
  );
};

export default Button;
