2019-06-10 18:36:31 +00:00
|
|
|
import React from 'react';
|
|
|
|
|
2022-04-07 14:10:03 +00:00
|
|
|
import { themes } from '../../lib/constants';
|
2022-05-02 19:21:15 +00:00
|
|
|
import { CustomIcon } from '../CustomIcon';
|
2019-06-10 18:36:31 +00:00
|
|
|
import styles from './styles';
|
2022-04-01 21:52:38 +00:00
|
|
|
import { useTheme } from '../../theme';
|
2019-06-10 18:36:31 +00:00
|
|
|
|
2022-04-01 21:52:38 +00:00
|
|
|
const ReadReceipt = React.memo(({ isReadReceiptEnabled, unread }: { isReadReceiptEnabled?: boolean; unread: boolean }) => {
|
|
|
|
const { theme } = useTheme();
|
2019-06-10 18:36:31 +00:00
|
|
|
if (isReadReceiptEnabled && !unread && unread !== null) {
|
2019-12-04 16:39:53 +00:00
|
|
|
return <CustomIcon name='check' color={themes[theme].tintColor} size={15} style={styles.readReceipt} />;
|
2019-06-10 18:36:31 +00:00
|
|
|
}
|
|
|
|
return null;
|
|
|
|
});
|
|
|
|
ReadReceipt.displayName = 'MessageReadReceipt';
|
|
|
|
|
|
|
|
export default ReadReceipt;
|