import React, { useCallback } from 'react'; import { Checkbox } from 'antd'; import { CheckboxChangeEvent } from 'antd/lib/checkbox'; import { TableProps } from './interface'; import styles from './table.module.scss'; interface IProps { total: number; checked: boolean; loading: boolean; toolNode: TableProps['toolNode']; onSelectAll(checked: boolean): void } function ToolNode({ total, checked, loading, toolNode, onSelectAll }: IProps) { const onChange = useCallback((e: CheckboxChangeEvent) => onSelectAll(e.target.checked), [onSelectAll]); return (
全选({total}条) {!loading && toolNode!(total)}
); } export default ToolNode;