2020-10-30 20:34:04 +00:00
|
|
|
// Copyright 2019-2020 Signal Messenger, LLC
|
|
|
|
// SPDX-License-Identifier: AGPL-3.0-only
|
|
|
|
|
2019-03-20 17:42:28 +00:00
|
|
|
import React from 'react';
|
|
|
|
|
|
|
|
import { LocalizerType } from '../../types/Util';
|
|
|
|
|
2020-08-24 13:57:00 +00:00
|
|
|
export type Props = {
|
2019-03-20 17:42:28 +00:00
|
|
|
count: number;
|
|
|
|
i18n: LocalizerType;
|
|
|
|
};
|
|
|
|
|
2020-09-14 19:51:27 +00:00
|
|
|
export const LastSeenIndicator = ({ count, i18n }: Props): JSX.Element => {
|
|
|
|
const message =
|
|
|
|
count === 1
|
|
|
|
? i18n('unreadMessage')
|
|
|
|
: i18n('unreadMessages', [String(count)]);
|
2019-03-20 17:42:28 +00:00
|
|
|
|
2020-09-14 19:51:27 +00:00
|
|
|
return (
|
|
|
|
<div className="module-last-seen-indicator">
|
|
|
|
<div className="module-last-seen-indicator__bar" />
|
|
|
|
<div className="module-last-seen-indicator__text">{message}</div>
|
|
|
|
</div>
|
|
|
|
);
|
|
|
|
};
|