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:
committed by
Facebook GitHub Bot
parent
44bb5b1beb
commit
fb7c09c972
33
desktop/flipper-plugin/src/ui/datatable/TableSearch.tsx
Normal file
33
desktop/flipper-plugin/src/ui/datatable/TableSearch.tsx
Normal 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>
|
||||
);
|
||||
});
|
||||
Reference in New Issue
Block a user