import * as React from 'react'; import get from 'lodash/get'; import { useLayoutObservableState } from 'observable-hooks'; import { useTheme } from 'styled-components/native'; import Pill from '@wcpos/components/src/pill'; import TextInput from '@wcpos/components/src/textinput'; import { useT } from '../../../contexts/translations'; /** * */ const SearchBar = ({ query }) => { const theme = useTheme(); const [search, setSearch] = React.useState(''); const status = get(query, ['selector', 'status']); const customerID = get(query, ['selector', 'customer_id']); // const hasFilters = status || customerID || customerID === 0; const t = useT(); /** * */ const onSearch = React.useCallback( (search) => { setSearch(search); query.debouncedSearch(search); }, [query] ); /** * */ return ( // {!!status && ( // setQuery('selector.status', null)} // icon="circle" // > // {status} // // )} // {!!(customerID || customerID === 0) && ( // setQuery('selector.customer_id', null)} // icon="user" // > // {t('Customer ID: {id}', { _tags: 'core', id: customerID })} // // )} // // ) // } containerStyle={{ flex: 1 }} clearable /> ); }; export default SearchBar;