import React from 'react';
import { Checkbox } from 'antd';
import IconFont from '../../../themeComponents/IconFont';

export default function CheckAll({ checkable, checkHalfStatus, checkExt, checkAllStatus, checkedKeys, onChange, disabled, checkableTitle, checkNum, list, destoryList }) {
  return (
    <div className="list-checkall">
      {checkable && (
        <Checkbox indeterminate={checkHalfStatus} checked={checkAllStatus} onChange={onChange} disabled={disabled}>
          {checkableTitle}
          {checkNum && (
            <>
              (已选 <span style={{ color: '#fd9838' }}>{checkedKeys.length}</span> / 总数 <span style={{ color: '#fd9838' }}>{list.length}</span>)
            </>
          )}
        </Checkbox>
      )}
      {destoryList && <IconFont type="icon-S_AID_delete" onClick={destoryList} />}
      {checkExt}
    </div>
  );
}
