import {FilterField, FilterButtonGroup} from '@components';
import {Card, Row} from 'antd';
import {FC} from 'react';
import {useExport, useSearch} from './hooks';

const Filter: FC = function() {
  const [{value}, {onSearch, onChange}] = useSearch();
  const onExport = useExport(value);

  return (
    <Card>
      <Row>
        <FilterField name='goodsCode' label='品号' value={value} onChange={onChange} />
        <FilterButtonGroup onSearch={onSearch} onExport={onExport} offset={12} />
      </Row>
    </Card>
  );
};

export default Filter;
