import { Button as AntButton } from 'antd';
import { useStatus } from 'client/hooks/useStatus';
import { Status } from 'core/types/elements';
import React from 'react';
import colors from 'client/UIKit/colors';

const Button = ({ type, name, text, onClick }) => {
  const { status } = useStatus(name);

  return (
    <AntButton
      style={{
        backgroundColor: colors.primary[0],
        borderColor: colors.primary[0]
      }}
      type={type}
      disabled={status === Status.Disabled}
      onClick={onClick}
    >
      {text}
    </AntButton>
  );
};

export default Button;
