import {Button, Space} from 'antd';
import css from './index.module.css';
import {FC} from 'react';

type Props = {
  onClose?: () => void,
  isLoading?: boolean,
};

const ModalBtnGroup: FC<Props> = function({isLoading, onClose}) {
  return (
    <Space className={css.dialogBtnGroup} data-testid='modal_btn_group'>
      <Button
        loading={isLoading}
        type='primary'
        htmlType='submit'
      >
        确定
      </Button>
      <Button
        disabled={isLoading}
        type='default'
        onClick={onClose}
        htmlType='button'
      >
        关闭
      </Button>
    </Space>
  );
};

export default ModalBtnGroup;
