Skip to content

Commit 091a219

Browse files
chore: improved AutoCompleteTagsMultiple typing
1 parent e5b96c5 commit 091a219

File tree

1 file changed

+9
-8
lines changed

1 file changed

+9
-8
lines changed

apps/meteor/client/omnichannel/tags/AutoCompleteTagsMultiple.tsx

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,26 @@
1-
import type { PaginatedMultiSelectOption } from '@rocket.chat/fuselage';
21
import { PaginatedMultiSelectFiltered } from '@rocket.chat/fuselage';
32
import { useDebouncedValue } from '@rocket.chat/fuselage-hooks';
3+
import type { ComponentProps } from 'react';
44
import { memo, useMemo, useState } from 'react';
55
import { useTranslation } from 'react-i18next';
66

77
import { useInfiniteTagsList } from '../../components/Omnichannel/hooks/useInfiniteTagsList';
88

9-
type AutoCompleteTagsMultipleProps = {
10-
id?: string;
11-
value?: PaginatedMultiSelectOption[];
12-
onChange?: (value: PaginatedMultiSelectOption[]) => void;
9+
type AutoCompleteTagsMultipleProps = Omit<
10+
ComponentProps<typeof PaginatedMultiSelectFiltered>,
11+
'filter' | 'setFilter' | 'options' | 'endReached' | 'renderItem'
12+
> & {
1313
department?: string;
1414
viewAll?: boolean;
1515
};
1616

1717
const AutoCompleteTagsMultiple = ({
18-
id,
1918
value = [],
2019
onChange = () => undefined,
2120
department,
2221
viewAll = false,
22+
placeholder,
23+
...props
2324
}: AutoCompleteTagsMultipleProps) => {
2425
const { t } = useTranslation();
2526
const [tagsFilter, setTagsFilter] = useState('');
@@ -39,8 +40,8 @@ const AutoCompleteTagsMultiple = ({
3940

4041
return (
4142
<PaginatedMultiSelectFiltered
42-
id={id}
4343
withTitle
44+
{...props}
4445
value={value}
4546
onChange={onChange}
4647
filter={tagsFilter}
@@ -49,7 +50,7 @@ const AutoCompleteTagsMultiple = ({
4950
width='100%'
5051
flexShrink={0}
5152
flexGrow={0}
52-
placeholder={t('Select_an_option')}
53+
placeholder={placeholder ?? t('Select_an_option')}
5354
endReached={() => fetchNextPage()}
5455
/>
5556
);

0 commit comments

Comments
 (0)