import {ChildrenFC} from '@utils';
import {Button, Space} from 'antd';

type Props = {
  onClick: () => void;
  testId?: string;
};

const TableTools: ChildrenFC<Props> = function({children, onClick, testId}) {
  return (
    <section className='table-tool'>
      <Space>
        <Button type='primary' onClick={onClick} data-testid={testId ?? 'add_btn'}>新增</Button>
        {children}
      </Space>
    </section>
  );
};

export default TableTools;
