// @flow import { SEARCH_OPTIONS } from 'constants/search'; import * as ICONS from 'constants/icons'; import React, { useMemo } from 'react'; import { Form, FormField } from 'component/common/form'; import Button from 'component/button'; type Props = { setSearchOption: (string, boolean | string | number) => void, options: {}, expanded: boolean, toggleSearchExpanded: () => void, }; const SearchOptions = (props: Props) => { const { options, setSearchOption, expanded, toggleSearchExpanded } = props; const stringifiedOptions = JSON.stringify(options); const resultCount = options[SEARCH_OPTIONS.RESULT_COUNT]; const isFilteringByChannel = useMemo(() => { const jsonOptions = JSON.parse(stringifiedOptions); const claimType = String(jsonOptions[SEARCH_OPTIONS.CLAIM_TYPE] || ''); return claimType.includes(SEARCH_OPTIONS.INCLUDE_CHANNELS); }, [stringifiedOptions]); return (