// Copyright 2021 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import React, { CSSProperties } from 'react'; import { ConversationColorType } from '../types/Colors'; import { LocalizerType } from '../types/Util'; import { formatRelativeTime } from '../util/formatRelativeTime'; export type PropsType = { backgroundStyle?: CSSProperties; color?: ConversationColorType; i18n: LocalizerType; includeAnotherBubble?: boolean; }; const A_FEW_DAYS_AGO = 60 * 60 * 24 * 5 * 1000; const SampleMessage = ({ color = 'ultramarine', direction, i18n, text, timestamp, status, style, }: { color?: ConversationColorType; direction: 'incoming' | 'outgoing'; i18n: LocalizerType; text: string; timestamp: number; status: 'delivered' | 'read' | 'sent'; style?: CSSProperties; }): JSX.Element => (
{text}
{formatRelativeTime(timestamp, { extended: true, i18n })} {direction === 'outgoing' && (
)}
); export const SampleMessageBubbles = ({ backgroundStyle = {}, color, i18n, includeAnotherBubble = false, }: PropsType): JSX.Element => { const firstBubbleStyle = includeAnotherBubble ? backgroundStyle : undefined; return ( <>
{includeAnotherBubble ? ( <>



) : null}
); };