header.tsx 698 B

1234567891011121314151617181920212223
  1. import { Input, Button } from 'antd'
  2. import type { GetExamplesParams, PagingRequest } from 'api'
  3. type ListHeaderProps = {
  4. onBeforeCreate?: () => void,
  5. onSearch: (params: (GetExamplesParams extends PagingRequest<infer T> ? T: never)) => void
  6. }
  7. export const ExampleHeader = ({ onSearch, onBeforeCreate }: ListHeaderProps) => {
  8. return (
  9. <div className='content-header'>
  10. <Button type="primary" children="创建案件" onClick={onBeforeCreate} />
  11. <Input.Search
  12. allowClear
  13. className='content-header-search'
  14. placeholder="输入名称搜索"
  15. onSearch={caseTitle => onSearch({ caseTitle }) }
  16. style={{ width: 264 }}
  17. />
  18. </div>
  19. )
  20. }