diff --git a/desktop/flipper-plugin/src/ui/PowerSearch/PowerSearchConfig.tsx b/desktop/flipper-plugin/src/ui/PowerSearch/PowerSearchConfig.tsx index f1ecc0653..dcbc89016 100644 --- a/desktop/flipper-plugin/src/ui/PowerSearch/PowerSearchConfig.tsx +++ b/desktop/flipper-plugin/src/ui/PowerSearch/PowerSearchConfig.tsx @@ -11,7 +11,7 @@ export type SimpleFilterValueType = 'NO_VALUE' | 'INTEGER' | 'FLOAT' | 'STRING'; -export type EnumFilterValueType = 'ENUM'; +export type EnumFilterValueType = 'ENUM' | 'ENUM_SET'; export type AbsoluteDateFilterValueType = 'ABSOLUTE_DATE'; diff --git a/desktop/flipper-plugin/src/ui/PowerSearch/PowerSearchEnumSetTerm.tsx b/desktop/flipper-plugin/src/ui/PowerSearch/PowerSearchEnumSetTerm.tsx new file mode 100644 index 000000000..76b6ac8a5 --- /dev/null +++ b/desktop/flipper-plugin/src/ui/PowerSearch/PowerSearchEnumSetTerm.tsx @@ -0,0 +1,62 @@ +/** + * 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 PowerSearchEnumSetTermProps = { + onCancel: () => void; + onChange: (value: string[]) => void; + enumLabels: {[key: string]: string}; +}; + +export const PowerSearchEnumSetTerm: 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 ( +