fix: tooltip on presence (#30474)

This commit is contained in:
Florian Duros
2025-08-04 15:54:38 +02:00
committed by GitHub
parent 475504d33b
commit 814f4a85df
2 changed files with 7 additions and 10 deletions

View File

@@ -55,17 +55,10 @@ export function RoomAvatarView({ room }: RoomAvatarViewProps): JSX.Element {
);
}
type PresenceDecorationProps = {
/**
* The presence of the user in the DM room.
*/
presence: NonNullable<Presence>;
};
/**
* Component to display the presence of a user in a DM room.
* Get the decoration for the avatar based on the presence.
*/
function PresenceDecoration({ presence }: PresenceDecorationProps): JSX.Element {
function getPresenceDecoration(presence: Presence): JSX.Element {
switch (presence) {
case Presence.Online:
return (
@@ -142,7 +135,7 @@ function getAvatarDecoration(decoration: AvatarBadgeDecoration, presence: Presen
/>
);
} else if (decoration === AvatarBadgeDecoration.Presence) {
return <PresenceDecoration presence={presence!} />;
return getPresenceDecoration(presence!);
}
}