|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
import { CallNotificationType, PropsForCallNotification } from '../../../../../state/ducks/types';
|
|
|
|
|
import { CallNotificationType } from '../../../../../state/ducks/types';
|
|
|
|
|
|
|
|
|
|
import { useSelectedNicknameOrProfileNameOrShortenedPubkey } from '../../../../../state/selectors/selectedConversation';
|
|
|
|
|
import { SessionIconType } from '../../../../icon';
|
|
|
|
@ -6,6 +6,8 @@ import { ExpirableReadableMessage } from '../ExpirableReadableMessage';
|
|
|
|
|
import { NotificationBubble } from './NotificationBubble';
|
|
|
|
|
import { Localizer } from '../../../../basic/Localizer';
|
|
|
|
|
import { MergedLocalizerTokens } from '../../../../../localization/localeTools';
|
|
|
|
|
import type { WithMessageId } from '../../../../../session/types/with';
|
|
|
|
|
import { useMessageCallNotificationType } from '../../../../../state/selectors';
|
|
|
|
|
|
|
|
|
|
type StyleType = Record<
|
|
|
|
|
CallNotificationType,
|
|
|
|
@ -30,11 +32,17 @@ const style = {
|
|
|
|
|
},
|
|
|
|
|
} satisfies StyleType;
|
|
|
|
|
|
|
|
|
|
export const CallNotification = (props: PropsForCallNotification) => {
|
|
|
|
|
const { messageId, notificationType } = props;
|
|
|
|
|
export const CallNotification = (props: WithMessageId) => {
|
|
|
|
|
const { messageId } = props;
|
|
|
|
|
|
|
|
|
|
const notificationType = useMessageCallNotificationType(messageId);
|
|
|
|
|
|
|
|
|
|
const name = useSelectedNicknameOrProfileNameOrShortenedPubkey() ?? window.i18n('unknown');
|
|
|
|
|
|
|
|
|
|
if (!notificationType) {
|
|
|
|
|
return null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const { iconColor, iconType, notificationTextKey } = style[notificationType];
|
|
|
|
|
|
|
|
|
|
return (
|
|
|
|
|