diff --git a/desktop/flipper-plugin/src/ui/PowerSearch/PowerSearchEnumTerm.tsx b/desktop/flipper-plugin/src/ui/PowerSearch/PowerSearchEnumTerm.tsx new file mode 100644 index 000000000..91e60fcc8 --- /dev/null +++ b/desktop/flipper-plugin/src/ui/PowerSearch/PowerSearchEnumTerm.tsx @@ -0,0 +1,56 @@ +/** + * Copyright (c) Meta Platforms, Inc. and 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 {Select} from 'antd'; +import React from 'react'; + +type PowerSearchEnumTermProps = { + onCancel: () => void; + onChange: (value: string) => void; + enumLabels: {[key: string]: string}; +}; + +export const PowerSearchEnumTerm: React.FC = ({ + onCancel, + onChange, + enumLabels, +}) => { + const options = React.useMemo(() => { + return Object.entries(enumLabels).map(([key, label]) => ({ + label, + value: key, + })); + }, [enumLabels]); + + const selectValueRef = React.useRef(); + + return ( +