diff --git a/src/client/components/feed/FeedChannelPicker.tsx b/src/client/components/feed/FeedChannelPicker.tsx index 714a220..5a1ece8 100644 --- a/src/client/components/feed/FeedChannelPicker.tsx +++ b/src/client/components/feed/FeedChannelPicker.tsx @@ -1,5 +1,5 @@ import { Button, Empty, Select, SelectProps } from 'antd'; -import React from 'react'; +import React, { useMemo } from 'react'; import { trpc } from '../../api/trpc'; import { useCurrentWorkspaceId } from '../../store/user'; import { PlusOutlined } from '@ant-design/icons'; @@ -16,6 +16,15 @@ export const FeedChannelPicker: React.FC = React.memo( workspaceId, }); + const options = useMemo( + () => + allChannels.map((m) => ({ + label: m.name, + value: m.id, + })), + [allChannels] + ); + return ( + options={options} + optionFilterProp="label" + /> ); } ); diff --git a/src/client/components/notification/NotificationPicker.tsx b/src/client/components/notification/NotificationPicker.tsx index 9f35af6..b84e99f 100644 --- a/src/client/components/notification/NotificationPicker.tsx +++ b/src/client/components/notification/NotificationPicker.tsx @@ -1,5 +1,5 @@ import { Button, Empty, Select, SelectProps } from 'antd'; -import React from 'react'; +import React, { useMemo } from 'react'; import { trpc } from '../../api/trpc'; import { useCurrentWorkspaceId } from '../../store/user'; import { ColorTag } from '../ColorTag'; @@ -17,6 +17,21 @@ export const NotificationPicker: React.FC = React.memo( workspaceId, }); + const options = useMemo( + () => + allNotification.map((notification) => ({ + label: ( +
+ + {notification.name} +
+ ), + value: notification.id, + desc: notification.name, + })), + [allNotification] + ); + return ( + options={options} + optionFilterProp="desc" + /> ); } );