diff --git a/apps/web/src/features/entity/composed/list-entity/channel.tsx b/apps/web/src/features/entity/composed/list-entity/channel.tsx index 4ec86ab5a58..6c472cd0c27 100644 --- a/apps/web/src/features/entity/composed/list-entity/channel.tsx +++ b/apps/web/src/features/entity/composed/list-entity/channel.tsx @@ -96,7 +96,6 @@ export function ChannelMessageNarrowBody(props: { export function ChannelLatestMessageNarrowBody(props: { message: NonNullable; - senderFirstName?: string; }) { return ( Attached Items} > + + :{' '} + diff --git a/apps/web/src/features/entity/composed/list-entity/narrow-inbox-layout.tsx b/apps/web/src/features/entity/composed/list-entity/narrow-inbox-layout.tsx index 23c18c9322e..cc2ba923383 100644 --- a/apps/web/src/features/entity/composed/list-entity/narrow-inbox-layout.tsx +++ b/apps/web/src/features/entity/composed/list-entity/narrow-inbox-layout.tsx @@ -1,5 +1,4 @@ import { useMaybeSoupView } from '@app/features/next-soup/soup-view/soup-view-context'; -import { tryMacroId, useDisplayNameParts } from '@core/user'; import { cn } from '@ui'; import { Match, Show, Switch } from 'solid-js'; import { MultiSelectCheckbox } from '../../components/MultiSelectCheckbox'; @@ -33,11 +32,6 @@ export function NarrowInboxLayout(props: LayoutProps) { isChannelEntity(props.entity) && props.entity.channelType === 'direct_message'; - const mostRecentMessageSenderName = () => - isChannelEntity(props.entity) && props.entity.latestMessage?.senderId - ? useDisplayNameParts(tryMacroId(props.entity.latestMessage?.senderId)) - : undefined; - const firstNotification = () => { if (!isWithNotification(props.entity)) return undefined; return filterNotDoneNotifications( @@ -142,12 +136,7 @@ export function NarrowInboxLayout(props: LayoutProps) { - {(msg) => ( - - )} + {(msg) => } {(entity) => ( diff --git a/apps/web/src/features/next-soup/soup-view/views/inbox/inbox-card-layouts.tsx b/apps/web/src/features/next-soup/soup-view/views/inbox/inbox-card-layouts.tsx index 5874c7e40c7..2ce26636112 100644 --- a/apps/web/src/features/next-soup/soup-view/views/inbox/inbox-card-layouts.tsx +++ b/apps/web/src/features/next-soup/soup-view/views/inbox/inbox-card-layouts.tsx @@ -12,7 +12,7 @@ import { import { UserIcon } from '@core/component/UserIcon'; import { isMacroAgentId } from '@core/constant/macroAgent'; import { useUserId } from '@core/context/user'; -import { tryMacroId, useDisplayName } from '@core/user'; +import { getDisplayName, tryMacroId } from '@core/user'; import { plural } from '@core/util/string'; import { DraftBadge, @@ -383,7 +383,10 @@ const createSenderDisplayName = ( return id ? tryMacroId(id) : undefined; }; - const [displayName] = useDisplayName(macroId()); + const displayName = () => { + const id = macroId(); + return id ? getDisplayName(id) : undefined; + }; const botName = () => { const id = senderId(); diff --git a/apps/web/src/lib/core/user/index.ts b/apps/web/src/lib/core/user/index.ts index e15a0a7a54b..76c1fc4bbef 100644 --- a/apps/web/src/lib/core/user/index.ts +++ b/apps/web/src/lib/core/user/index.ts @@ -8,6 +8,7 @@ export { } from './combinedRecipient'; export { useContacts } from './contactService'; export { + getDisplayName, getInitials, getInitialsFromName, seedMockDisplayNames,