Loading properties...
+ )
+}
+
+const PropertyNamesSelectBox = ({ onChange }: { onChange?: (selectedProperties: string[]) => void }): JSX.Element => {
+ const { properties, selectedProperties, selectAll, clearAll, selectState } = useSelectedProperties()
+
+ const {
+ isOpen: isSearchOpen,
+ popoverProps,
+ triggerProps,
+ } = usePopover({
+ onHide: () => {
+ if (onChange) {
+ onChange(Array.from(selectedProperties))
+ }
+ },
+ })
+
+ return (
+
+ {filteredProperties.length ? (
+ filteredProperties.map((property) => (
+
toggleProperty(property.name)}
+ >
+ {property.highlightedName}
+
+ ))
+ ) : (
+
+ No properties match “{query}”. Refine your search to try again.
+
+ )}
+
+ >
+ )
+}
+
+// eslint-disable-next-line @typescript-eslint/explicit-function-return-type
+const usePopover = ({ onHide }: { onHide: () => void }) => {
+ /* Logic for handling arbitrary popover state */
+ const [isOpen, setIsOpen] = React.useState