From efa9c6723d48ee3690d67f97d080607b5f8c487a Mon Sep 17 00:00:00 2001 From: nkdengineer Date: Thu, 23 Jan 2025 16:11:50 +0700 Subject: [PATCH] fix lint --- src/components/TagPicker/index.tsx | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/components/TagPicker/index.tsx b/src/components/TagPicker/index.tsx index 67e7c473f268..c086ddfa6341 100644 --- a/src/components/TagPicker/index.tsx +++ b/src/components/TagPicker/index.tsx @@ -4,11 +4,11 @@ import SelectionList from '@components/SelectionList'; import RadioListItem from '@components/SelectionList/RadioListItem'; import useLocalize from '@hooks/useLocalize'; import useThemeStyles from '@hooks/useThemeStyles'; -import * as OptionsListUtils from '@libs/OptionsListUtils'; -import * as PolicyUtils from '@libs/PolicyUtils'; -import type * as ReportUtils from '@libs/ReportUtils'; +import {getHeaderMessageForNonUserList} from '@libs/OptionsListUtils'; +import {getCountOfEnabledTagsOfList, getTagList} from '@libs/PolicyUtils'; +import type {OptionData} from '@libs/ReportUtils'; import type {SelectedTagOption} from '@libs/TagsOptionsListUtils'; -import * as TagOptionListUtils from '@libs/TagsOptionsListUtils'; +import {getTagListSections} from '@libs/TagsOptionsListUtils'; import CONST from '@src/CONST'; import ONYXKEYS from '@src/ONYXKEYS'; import type {PolicyTag, PolicyTags} from '@src/types/onyx'; @@ -26,7 +26,7 @@ type TagPickerProps = { tagListName: string; /** Callback to submit the selected tag */ - onSubmit: (selectedTag: Partial) => void; + onSubmit: (selectedTag: Partial) => void; /** Should show the selected option that is disabled? */ shouldShowDisabledAndSelectedOption?: boolean; @@ -46,8 +46,8 @@ function TagPicker({selectedTag, tagListName, policyID, tagListIndex, shouldShow const [searchValue, setSearchValue] = useState(''); const policyRecentlyUsedTagsList = useMemo(() => policyRecentlyUsedTags?.[tagListName] ?? [], [policyRecentlyUsedTags, tagListName]); - const policyTagList = PolicyUtils.getTagList(policyTags, tagListIndex); - const policyTagsCount = PolicyUtils.getCountOfEnabledTagsOfList(policyTagList.tags); + const policyTagList = getTagList(policyTags, tagListIndex); + const policyTagsCount = getCountOfEnabledTagsOfList(policyTagList.tags); const isTagsCountBelowThreshold = policyTagsCount < CONST.STANDARD_LIST_ITEM_LIMIT; const shouldShowTextInput = !isTagsCountBelowThreshold; @@ -76,7 +76,7 @@ function TagPicker({selectedTag, tagListName, policyID, tagListIndex, shouldShow }, [selectedOptions, policyTagList, shouldShowDisabledAndSelectedOption]); const sections = useMemo(() => { - const tagSections = TagOptionListUtils.getTagListSections({ + const tagSections = getTagListSections({ searchValue, selectedOptions, tags: enabledTags, @@ -90,7 +90,7 @@ function TagPicker({selectedTag, tagListName, policyID, tagListIndex, shouldShow : tagSections; }, [searchValue, selectedOptions, enabledTags, policyRecentlyUsedTagsList, shouldOrderListByTagName]); - const headerMessage = OptionsListUtils.getHeaderMessageForNonUserList((sections?.at(0)?.data?.length ?? 0) > 0, searchValue); + const headerMessage = getHeaderMessageForNonUserList((sections?.at(0)?.data?.length ?? 0) > 0, searchValue); const selectedOptionKey = sections.at(0)?.data?.filter((policyTag) => policyTag.searchText === selectedTag)?.[0]?.keyForList;