import { Button as AntButton } from 'antd';
import { Status } from 'core/types/statuses';
import React from 'react';

const Button = ({ status, action, text, ...props }) => {
  return (
    <AntButton
      {...props}
      disabled={status === Status.Disabled}
      loading={status === Status.Loading}
      onClick={() => {
        if (action) action();
      }}
    >
      {text}
    </AntButton>
  );
};

export default Button;
