Добавлено отображение поиска пользователей

This commit is contained in:
Александр Сироткин 2022-02-25 17:12:56 +05:00
parent b791a5418a
commit e84cc40f09

View File

@ -22,6 +22,7 @@ export const CategoryEditor = memo(({ idWell, visible, category, onClosed }) =>
const [users, setUsers] = useState([]) const [users, setUsers] = useState([])
const [allUsers, setAllUsers] = useState([]) const [allUsers, setAllUsers] = useState([])
const [filteredUsers, setFilteredUsers] = useState([]) const [filteredUsers, setFilteredUsers] = useState([])
const [isSearching, setIsSearching] = useState(false)
const [showLoader, setShowLoader] = useState(false) const [showLoader, setShowLoader] = useState(false)
const [searchValue, setSearchValue] = useState('') const [searchValue, setSearchValue] = useState('')
const [subject, setSubject] = useState(null) const [subject, setSubject] = useState(null)
@ -40,7 +41,7 @@ export const CategoryEditor = memo(({ idWell, visible, category, onClosed }) =>
].join(' ').toLowerCase().includes(searchValue)) ].join(' ').toLowerCase().includes(searchValue))
setFilteredUsers(filteredUsers) setFilteredUsers(filteredUsers)
}, },
setShowLoader, setIsSearching,
`Не удалось произвести поиск пользователей` `Не удалось произвести поиск пользователей`
), [users, searchValue]) ), [users, searchValue])
@ -152,6 +153,7 @@ export const CategoryEditor = memo(({ idWell, visible, category, onClosed }) =>
placeholder={'Поиск пользователя'} placeholder={'Поиск пользователя'}
onChange={onSearchTextChange} onChange={onSearchTextChange}
style={{ marginBottom: '15px' }} style={{ marginBottom: '15px' }}
loading={isSearching}
/> />
<LoaderPortal show={showLoader}> <LoaderPortal show={showLoader}>
<Table <Table