import React from 'react';
import { useDispatch } from 'react-redux';
import styled from 'styled-components';
import { LastMessageStatusType } from '../../../../state/ducks/conversations';
import { SessionIcon } from '../../../icon';
import { showMessageInfoOverlay } from './MessageContextMenu';
const MessageStatusSendingContainer = styled.div`
display: inline-block;
align-self: flex-end;
margin-bottom: 2px;
margin-inline-start: 5px;
cursor: pointer;
`;
const iconColor = 'var(--text-primary-color)';
const MessageStatusSending = ({ dataTestId }: { dataTestId?: string }) => {
return (
);
};
const MessageStatusSent = ({ dataTestId }: { dataTestId?: string }) => {
return (
);
};
const MessageStatusRead = ({ dataTestId }: { dataTestId?: string }) => {
return (
);
};
const MessageStatusError = ({
messageId,
dataTestId,
}: {
messageId?: string;
dataTestId?: string;
}) => {
const dispatch = useDispatch();
return (
{
if (messageId) {
void showMessageInfoOverlay({ messageId, dispatch });
}
}}
title={window.i18n('sendFailed')}
>
);
};
export const OutgoingMessageStatus = (props: {
status: LastMessageStatusType | null;
messageId?: string;
dataTestId?: string;
}) => {
const { status, messageId, dataTestId } = props;
switch (status) {
case 'sending':
return ;
case 'sent':
return ;
case 'read':
return ;
case 'error':
return ;
default:
return null;
}
};