// @flow import * as ICONS from 'constants/icons'; import React, { useState } from 'react'; import { SEARCH_OPTIONS } from 'lbry-redux'; import { Form, FormField } from 'component/common/form'; import posed from 'react-pose'; import Button from 'component/button'; const ExpandableOptions = posed.div({ hide: { height: 0, opacity: 0 }, show: { height: 280, opacity: 1 }, }); type Props = { setSearchOption: (string, boolean | string | number) => void, options: {}, }; const SearchOptions = (props: Props) => { const { options, setSearchOption } = props; const [expanded, setExpanded] = useState(false); const resultCount = options[SEARCH_OPTIONS.RESULT_COUNT]; return (
*/}
{expanded && (
{__('Search For')} {[ { option: SEARCH_OPTIONS.INCLUDE_FILES, label: __('Files'), }, { option: SEARCH_OPTIONS.INCLUDE_CHANNELS, label: __('Channels'), }, { option: SEARCH_OPTIONS.INCLUDE_FILES_AND_CHANNELS, label: __('Everything'), }, ].map(({ option, label }) => ( setSearchOption(SEARCH_OPTIONS.CLAIM_TYPE, option)} /> ))}
{__('File Types')} {[ { option: SEARCH_OPTIONS.MEDIA_VIDEO, label: __('Videos'), }, { option: SEARCH_OPTIONS.MEDIA_AUDIO, label: __('Sounds'), }, { option: SEARCH_OPTIONS.MEDIA_IMAGE, label: __('Images'), }, { option: SEARCH_OPTIONS.MEDIA_TEXT, label: __('Text'), }, { option: SEARCH_OPTIONS.MEDIA_APPLICATION, label: __('Other Files'), }, ].map(({ option, label }) => ( setSearchOption(option, !options[option])} /> ))}
{__('Other Options')} setSearchOption(SEARCH_OPTIONS.RESULT_COUNT, e.target.value)} blockWrap={false} label={__('Returned Results')} />
)}
); }; export default SearchOptions;