/**
 * 停止按钮
 * 
 */
import { DeleteOutlined } from '@ant-design/icons';
import { useIntl } from '@umijs/max';
import { Button, Popconfirm } from 'antd';
import { proIconForTableActionStyle } from '../../../config/defaultIcon';
import { FormattedMessage } from 'react-intl';

type StopBtnProps = {
  // eslint-disable-next-line @typescript-eslint/ban-types
  buttonType?: 'defalut' | 'deleteIcon';
  deleteApi: () => void;
};

const StopBtn: React.FC<StopBtnProps> = (props) => {
  const intl = useIntl();

  return (
    <Popconfirm
      key="destroy"
      placement="topLeft"
      title={intl.formatMessage({ id: 'common.tip.title', defaultMessage: '$$$' })}
      description={intl.formatMessage({
        id: 'common.modal.table.stop.content',
        defaultMessage: '$$$',
      })}
      okText={intl.formatMessage({ id: 'common.yes', defaultMessage: '$$$' })}
      cancelText={intl.formatMessage({ id: 'common.no', defaultMessage: '$$$' })}
      onConfirm={() => {
        props.deleteApi();
      }}
    >
        {/* {props.buttonType === 'deleteIcon' ? (
          <>
            <DeleteOutlined style={{
              color: "rgba(232, 13, 13, 1)",
            ...proIconForTableActionStyle
            }} />
          </>
        ) : (
          <Button type="link" size="small" danger>
            <FormattedMessage id="pages.searchTable.destroy" defaultMessage="Destroy" />
          </Button>
        )} */}
        <Button type="link" size="small" danger>
            <FormattedMessage id="pages.searchTable.stop" defaultMessage="Destroy" />
        </Button>
    </Popconfirm>
  );
};

export default StopBtn;
