diff --git a/www/app/(app)/transcripts/shareZulip.tsx b/www/app/(app)/transcripts/shareZulip.tsx index 5cee16c1..bee14822 100644 --- a/www/app/(app)/transcripts/shareZulip.tsx +++ b/www/app/(app)/transcripts/shareZulip.tsx @@ -14,8 +14,7 @@ import { Checkbox, Combobox, Spinner, - useFilter, - useListCollection, + createListCollection, } from "@chakra-ui/react"; import { TbBrandZulip } from "react-icons/tb"; import { @@ -48,8 +47,6 @@ export default function ShareZulip(props: ShareZulipProps & BoxProps) { const { data: topics = [] } = useZulipTopics(selectedStreamId); const postToZulipMutation = useTranscriptPostToZulip(); - const { contains } = useFilter({ sensitivity: "base" }); - const streamItems = useMemo(() => { return streams.map((stream: Stream) => ({ label: stream.name, @@ -64,17 +61,21 @@ export default function ShareZulip(props: ShareZulipProps & BoxProps) { })); }, [topics]); - const { collection: streamItemsCollection, filter: streamItemsFilter } = - useListCollection({ - initialItems: streamItems, - filter: contains, - }); + const streamCollection = useMemo( + () => + createListCollection({ + items: streamItems, + }), + [streamItems], + ); - const { collection: topicItemsCollection, filter: topicItemsFilter } = - useListCollection({ - initialItems: topicItems, - filter: contains, - }); + const topicCollection = useMemo( + () => + createListCollection({ + items: topicItems, + }), + [topicItems], + ); // Update selected stream ID when stream changes useEffect(() => { @@ -156,15 +157,12 @@ export default function ShareZulip(props: ShareZulipProps & BoxProps) { # { setTopic(undefined); setStream(e.value[0]); }} - onInputValueChange={(e) => - streamItemsFilter(e.inputValue) - } openOnClick={true} positioning={{ strategy: "fixed", @@ -181,7 +179,7 @@ export default function ShareZulip(props: ShareZulipProps & BoxProps) { No streams found - {streamItemsCollection.items.map((item) => ( + {streamItems.map((item) => ( {item.label} @@ -197,12 +195,9 @@ export default function ShareZulip(props: ShareZulipProps & BoxProps) { # setTopic(e.value[0])} - onInputValueChange={(e) => - topicItemsFilter(e.inputValue) - } openOnClick selectionBehavior="replace" skipAnimationOnMount={true} @@ -222,7 +217,7 @@ export default function ShareZulip(props: ShareZulipProps & BoxProps) { No topics found - {topicItemsCollection.items.map((item) => ( + {topicItems.map((item) => ( {item.label}