import classNames from 'clsx'; import React from 'react'; import { defineMessages, useIntl } from 'react-intl'; import { fetchListSuggestions, clearListSuggestions, changeListSuggestions } from 'soapbox/actions/lists'; import Icon from 'soapbox/components/icon'; import { Button, Form, HStack, Input } from 'soapbox/components/ui'; import { useAppSelector, useAppDispatch } from 'soapbox/hooks'; const messages = defineMessages({ search: { id: 'lists.search', defaultMessage: 'Search among people you follow' }, searchTitle: { id: 'tabs_bar.search', defaultMessage: 'Search' }, }); const Search = () => { const intl = useIntl(); const dispatch = useAppDispatch(); const value = useAppSelector((state) => state.listEditor.suggestions.value); const handleChange: React.ChangeEventHandler = e => { dispatch(changeListSuggestions(e.target.value)); }; const handleSubmit = () => { dispatch(fetchListSuggestions(value)); }; const handleClear = () => { dispatch(clearListSuggestions()); }; const hasValue = value.length > 0; return (
); }; export default Search;