// Copyright 2019-2020 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import * as React from 'react'; import * as styles from './MessageMeta.scss'; import { useI18n } from '../util/i18n'; export type Props = { kind?: 'bubble' | 'dark' | 'light'; minutesAgo: number; }; const getItemClass = ({ kind }: Props) => { if (kind === 'dark') { return styles.dark; } if (kind === 'light') { return styles.light; } return styles.bubble; }; export const MessageMeta = React.memo((props: Props) => { const i18n = useI18n(); const itemClass = getItemClass(props); return (
{i18n('minutesAgo', [props.minutesAgo])}
); });