@@ -12,6 +12,7 @@ import { ChatCircleIcon } from "../../shared/design-system/icons/index";
1212import { channelIcon } from "../../features/channels/channel-icon" ;
1313import { ChannelActivityPopover } from "./ChannelActivityPopover" ;
1414import { ChannelSidebarRow } from "./ChannelSidebarRow" ;
15+ import { DmTypingBadge } from "./DmTypingBadge" ;
1516import { usePresenceStatus } from "../../features/presence/react" ;
1617import { UnreadBadge } from "./UnreadBadge" ;
1718import styles from "./Channels.module.css" ;
@@ -91,32 +92,37 @@ export const ChannelSidebarItem = memo(function ChannelSidebarItem({
9192 channel = { channel }
9293 dmVisualSpacing = { channel . channelType === "dm" }
9394 icon = {
94- channel . channelType === "dm" && channel . participants ?. length === 1 ? (
95- < span className = { styles . dmAvatar } data-dm-identity = "" >
96- < Avatar
97- src = {
98- profile ?. picture
99- ? session . media ( profile . picture , "small" )
100- : undefined
101- }
102- alt = ""
103- fallback = { channel . name }
104- size = "fill"
105- shape = { profile ?. isAgent ? "squircle" : "circle" }
106- statusBadge = { presence === "unknown" ? undefined : presence }
107- />
108- </ span >
109- ) : channel . channelType === "dm" &&
110- ( channel . participants ?. length ?? 0 ) > 1 ? (
111- < span
112- className = { styles . dmCount }
113- data-dm-identity = ""
114- data-dm-participant-count = ""
115- title = { `${ channel . participants ?. length } other participants` }
116- aria-hidden = "true"
117- >
118- { channel . participants ?. length }
119- </ span >
95+ channel . channelType === "dm" ? (
96+ < DmTypingBadge session = { session } channelId = { channel . id } >
97+ { channel . participants ?. length === 1 ? (
98+ < span className = { styles . dmAvatar } data-dm-identity = "" >
99+ < Avatar
100+ src = {
101+ profile ?. picture
102+ ? session . media ( profile . picture , "small" )
103+ : undefined
104+ }
105+ alt = ""
106+ fallback = { channel . name }
107+ size = "fill"
108+ shape = { profile ?. isAgent ? "squircle" : "circle" }
109+ statusBadge = { presence === "unknown" ? undefined : presence }
110+ />
111+ </ span >
112+ ) : ( channel . participants ?. length ?? 0 ) > 1 ? (
113+ < span
114+ className = { styles . dmCount }
115+ data-dm-identity = ""
116+ data-dm-participant-count = ""
117+ title = { `${ channel . participants ?. length } other participants` }
118+ aria-hidden = "true"
119+ >
120+ { channel . participants ?. length }
121+ </ span >
122+ ) : (
123+ < Icon size = { 16 } />
124+ ) }
125+ </ DmTypingBadge >
120126 ) : (
121127 < Icon size = { 16 } />
122128 )
0 commit comments