// Copyright 2021-2022 Signal Messenger, LLC // SPDX-License-Identifier: AGPL-3.0-only import type { CSSProperties } from 'react'; import React from 'react'; import type { ConversationColorType } from '../types/Colors'; import type { LocalizerType } from '../types/Util'; import { formatTime } from '../util/timestamp'; 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, timestampDeltaFromNow, status, style, }: { color?: ConversationColorType; direction: 'incoming' | 'outgoing'; i18n: LocalizerType; text: string; timestampDeltaFromNow: number; status: 'delivered' | 'read' | 'sent'; style?: CSSProperties; }): JSX.Element => (
{text}
{formatTime(i18n, Date.now() - timestampDeltaFromNow, Date.now())} {direction === 'outgoing' && (
)}
); export const SampleMessageBubbles = ({ backgroundStyle = {}, color, i18n, includeAnotherBubble = false, }: PropsType): JSX.Element => { const firstBubbleStyle = includeAnotherBubble ? backgroundStyle : undefined; return ( <>
{includeAnotherBubble ? ( <>



) : null}
); };