Add support for search and custom actions

Summary: Introduced search bar and support for custom buttons therein.

Reviewed By: nikoant

Differential Revision: D26338666

fbshipit-source-id: e53cd3c4381e11f5f90c05c92e39a6c8ac2eca65
This commit is contained in:
Michel Weststrate
2021-03-16 14:54:53 -07:00
committed by Facebook GitHub Bot
parent 44bb5b1beb
commit fb7c09c972
6 changed files with 147 additions and 13 deletions

View File

@@ -0,0 +1,33 @@
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
*/
import {Input} from 'antd';
import React, {memo} from 'react';
import {Layout} from '../Layout';
import {theme} from '../theme';
export const TableSearch = memo(function TableSearch({
onSearch,
extraActions,
}: {
onSearch(value: string): void;
extraActions?: React.ReactElement;
}) {
return (
<Layout.Horizontal
gap
style={{
backgroundColor: theme.backgroundWash,
padding: theme.space.small,
}}>
<Input.Search allowClear placeholder="Search..." onSearch={onSearch} />
{extraActions}
</Layout.Horizontal>
);
});