import Typography from '@material-hu/mui/Typography';

import Button from '@material-hu/components/design-system/Buttons/Button';

export type CardButtonProps = {
  title: string;
  ElementIcon: any;
  handleOnClick: any;
};

const CardButton = (props: CardButtonProps) => {
  const { title, ElementIcon, handleOnClick } = props;

  return (
    <Button
      sx={{
        mr: 2,
        height: 'fit-content',
        color: theme => theme.palette.new.text.neutral.default,
      }}
      onClick={handleOnClick}
      startIcon={ElementIcon}
    >
      <Typography
        variant="globalXS"
        fontWeight="fontWeightSemiBold"
      >
        {title}
      </Typography>
    </Button>
  );
};

export default CardButton;
