signal-desktop/ts/components/conversation/LastSeenIndicator.tsx

34 lines
840 B
TypeScript
Raw Normal View History

2023-01-03 19:55:46 +00:00
// Copyright 2019 Signal Messenger, LLC
2020-10-30 20:34:04 +00:00
// SPDX-License-Identifier: AGPL-3.0-only
import React, { forwardRef } from 'react';
import type { LocalizerType } from '../../types/Util';
2020-08-24 13:57:00 +00:00
export type Props = {
count: number;
i18n: LocalizerType;
};
export const LastSeenIndicator = forwardRef<HTMLDivElement, Props>(
2022-11-18 00:45:19 +00:00
function LastSeenIndicatorInner({ count, i18n }, ref) {
const message =
count === 1
2023-03-30 00:03:25 +00:00
? i18n('icu:unreadMessage')
2023-04-03 19:03:00 +00:00
: i18n('icu:unreadMessages', { count });
return (
<div className="module-last-seen-indicator" ref={ref}>
<div className="module-last-seen-indicator__bar" role="separator" />
<div
aria-level={6}
className="module-last-seen-indicator__text"
role="heading"
>
{message}
</div>
</div>
);
}
);