From 039b695695ea7ea7b047b2633c0e22f8b4e13d00 Mon Sep 17 00:00:00 2001 From: Martin Schoeler Date: Wed, 18 Aug 2021 12:52:20 -0300 Subject: [PATCH] [IMPROVE] Use tag autocomplete (#22902) Co-authored-by: Tiago Evangelista Pinto --- ee/client/omnichannel/tags/CurrentChatTags.js | 35 ------------------- .../omnichannel/tags/CurrentChatTags.tsx | 9 +++++ 2 files changed, 9 insertions(+), 35 deletions(-) delete mode 100644 ee/client/omnichannel/tags/CurrentChatTags.js create mode 100644 ee/client/omnichannel/tags/CurrentChatTags.tsx diff --git a/ee/client/omnichannel/tags/CurrentChatTags.js b/ee/client/omnichannel/tags/CurrentChatTags.js deleted file mode 100644 index 41af19e48767..000000000000 --- a/ee/client/omnichannel/tags/CurrentChatTags.js +++ /dev/null @@ -1,35 +0,0 @@ -import { PaginatedMultiSelectFiltered } from '@rocket.chat/fuselage'; -import React, { useMemo, useState } from 'react'; - -import { useRecordList } from '../../../../client/hooks/lists/useRecordList'; -import { AsyncStatePhase } from '../../../../client/hooks/useAsyncState'; -import { useTagsList } from '../../hooks/useTagsList'; - -const CurrentChatTags = ({ value, handler }) => { - const [tagsFilter, setTagsFilter] = useState(''); - - const { itemsList: tagsList, loadMoreItems: loadMoreTags } = useTagsList( - useMemo(() => ({ filter: tagsFilter }), [tagsFilter]), - ); - - const { phase: tagsPhase, items: tagsItems, itemCount: tagsTotal } = useRecordList(tagsList); - - return ( - {} - : (start) => loadMoreTags(start, Math.min(50, tagsTotal)) - } - /> - ); -}; - -export default CurrentChatTags; diff --git a/ee/client/omnichannel/tags/CurrentChatTags.tsx b/ee/client/omnichannel/tags/CurrentChatTags.tsx new file mode 100644 index 000000000000..7a19e6ca999a --- /dev/null +++ b/ee/client/omnichannel/tags/CurrentChatTags.tsx @@ -0,0 +1,9 @@ +import React, { FC } from 'react'; + +import AutoCompleteTagsMultiple from './AutoCompleteTagsMultiple'; + +const CurrentChatTags: FC<{ value: Array; handler: () => void }> = ({ value, handler }) => ( + +); + +export default CurrentChatTags;