diff --git a/src/backend/core/api/openapi.json b/src/backend/core/api/openapi.json index 7a11eadb..0c853852 100644 --- a/src/backend/core/api/openapi.json +++ b/src/backend/core/api/openapi.json @@ -6351,6 +6351,11 @@ "readOnly": true, "nullable": true }, + "delivery_message": { + "type": "string", + "readOnly": true, + "nullable": true + }, "retry_at": { "type": "string", "format": "date-time", @@ -6367,6 +6372,7 @@ "required": [ "contact", "delivered_at", + "delivery_message", "delivery_status", "retry_at" ] diff --git a/src/backend/core/api/serializers.py b/src/backend/core/api/serializers.py index 73baf53d..e3895720 100644 --- a/src/backend/core/api/serializers.py +++ b/src/backend/core/api/serializers.py @@ -602,12 +602,13 @@ class MessageRecipientSerializer(serializers.ModelSerializer): read_only=True, allow_null=True, ) + delivery_message = serializers.CharField(read_only=True, allow_null=True) retry_at = serializers.DateTimeField(read_only=True, allow_null=True) delivered_at = serializers.DateTimeField(read_only=True, allow_null=True) class Meta: model = models.MessageRecipient - fields = ["contact", "delivery_status", "retry_at", "delivered_at"] + fields = ["contact", "delivery_status", "delivery_message", "retry_at", "delivered_at"] class MessageSerializer(serializers.ModelSerializer): diff --git a/src/backend/locale/br_FR/LC_MESSAGES/django.mo b/src/backend/locale/br_FR/LC_MESSAGES/django.mo index 6890da77..8b8cf176 100644 Binary files a/src/backend/locale/br_FR/LC_MESSAGES/django.mo and b/src/backend/locale/br_FR/LC_MESSAGES/django.mo differ diff --git a/src/backend/locale/br_FR/LC_MESSAGES/django.po b/src/backend/locale/br_FR/LC_MESSAGES/django.po index 0fb412da..b05b78e4 100644 --- a/src/backend/locale/br_FR/LC_MESSAGES/django.po +++ b/src/backend/locale/br_FR/LC_MESSAGES/django.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: lasuite-messages\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-15 12:16+0000\n" -"PO-Revision-Date: 2025-10-15 12:15\n" +"POT-Creation-Date: 2025-10-16 14:12+0000\n" +"PO-Revision-Date: 2025-10-16 14:11\n" "Last-Translator: \n" "Language-Team: Breton\n" "Language: br_FR\n" @@ -61,7 +61,7 @@ msgstr "" msgid "Keys" msgstr "" -#: core/api/serializers.py:1024 +#: core/api/serializers.py:1031 msgid "A mailbox with this local part already exists in this domain." msgstr "" @@ -724,7 +724,7 @@ msgid "" msgstr "" #: core/models.py:1687 -msgid "Type of template (reply, new_message, signature)" +msgid "Type of template (message, signature)" msgstr "" #: core/models.py:1693 diff --git a/src/backend/locale/de_DE/LC_MESSAGES/django.mo b/src/backend/locale/de_DE/LC_MESSAGES/django.mo index dc0fb2fb..0474429b 100644 Binary files a/src/backend/locale/de_DE/LC_MESSAGES/django.mo and b/src/backend/locale/de_DE/LC_MESSAGES/django.mo differ diff --git a/src/backend/locale/de_DE/LC_MESSAGES/django.po b/src/backend/locale/de_DE/LC_MESSAGES/django.po index 8acda623..0d339b0a 100644 --- a/src/backend/locale/de_DE/LC_MESSAGES/django.po +++ b/src/backend/locale/de_DE/LC_MESSAGES/django.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: lasuite-messages\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-15 12:16+0000\n" -"PO-Revision-Date: 2025-10-15 12:15\n" +"POT-Creation-Date: 2025-10-16 14:12+0000\n" +"PO-Revision-Date: 2025-10-16 14:11\n" "Last-Translator: \n" "Language-Team: German\n" "Language: de_DE\n" @@ -58,7 +58,7 @@ msgstr "" msgid "Keys" msgstr "" -#: core/api/serializers.py:1024 +#: core/api/serializers.py:1031 msgid "A mailbox with this local part already exists in this domain." msgstr "" @@ -721,7 +721,7 @@ msgid "" msgstr "" #: core/models.py:1687 -msgid "Type of template (reply, new_message, signature)" +msgid "Type of template (message, signature)" msgstr "" #: core/models.py:1693 diff --git a/src/backend/locale/en_US/LC_MESSAGES/django.po b/src/backend/locale/en_US/LC_MESSAGES/django.po index 9d197998..38042b6b 100644 --- a/src/backend/locale/en_US/LC_MESSAGES/django.po +++ b/src/backend/locale/en_US/LC_MESSAGES/django.po @@ -2,7 +2,7 @@ msgid "" msgstr "" "Project-Id-Version: lasuite-docs\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-15 12:16+0000\n" +"POT-Creation-Date: 2025-10-16 14:12+0000\n" "PO-Revision-Date: 2025-01-27 09:27\n" "Last-Translator: \n" "Language-Team: English\n" @@ -58,7 +58,7 @@ msgstr "" msgid "Keys" msgstr "" -#: core/api/serializers.py:1024 +#: core/api/serializers.py:1031 msgid "A mailbox with this local part already exists in this domain." msgstr "" @@ -721,7 +721,7 @@ msgid "" msgstr "" #: core/models.py:1687 -msgid "Type of template (reply, new_message, signature)" +msgid "Type of template (message, signature)" msgstr "" #: core/models.py:1693 diff --git a/src/backend/locale/es_ES/LC_MESSAGES/django.mo b/src/backend/locale/es_ES/LC_MESSAGES/django.mo index cc60205e..af9e0843 100644 Binary files a/src/backend/locale/es_ES/LC_MESSAGES/django.mo and b/src/backend/locale/es_ES/LC_MESSAGES/django.mo differ diff --git a/src/backend/locale/es_ES/LC_MESSAGES/django.po b/src/backend/locale/es_ES/LC_MESSAGES/django.po index c7375f15..0d019214 100644 --- a/src/backend/locale/es_ES/LC_MESSAGES/django.po +++ b/src/backend/locale/es_ES/LC_MESSAGES/django.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: lasuite-messages\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-15 12:16+0000\n" -"PO-Revision-Date: 2025-10-15 12:15\n" +"POT-Creation-Date: 2025-10-16 14:12+0000\n" +"PO-Revision-Date: 2025-10-16 14:11\n" "Last-Translator: \n" "Language-Team: Spanish\n" "Language: es_ES\n" @@ -58,7 +58,7 @@ msgstr "" msgid "Keys" msgstr "" -#: core/api/serializers.py:1024 +#: core/api/serializers.py:1031 msgid "A mailbox with this local part already exists in this domain." msgstr "" @@ -721,7 +721,7 @@ msgid "" msgstr "" #: core/models.py:1687 -msgid "Type of template (reply, new_message, signature)" +msgid "Type of template (message, signature)" msgstr "" #: core/models.py:1693 diff --git a/src/backend/locale/fr_FR/LC_MESSAGES/django.mo b/src/backend/locale/fr_FR/LC_MESSAGES/django.mo index 6b40b871..6aa68b51 100644 Binary files a/src/backend/locale/fr_FR/LC_MESSAGES/django.mo and b/src/backend/locale/fr_FR/LC_MESSAGES/django.mo differ diff --git a/src/backend/locale/fr_FR/LC_MESSAGES/django.po b/src/backend/locale/fr_FR/LC_MESSAGES/django.po index ad33b873..bad2f293 100644 --- a/src/backend/locale/fr_FR/LC_MESSAGES/django.po +++ b/src/backend/locale/fr_FR/LC_MESSAGES/django.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: lasuite-messages\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-15 12:16+0000\n" -"PO-Revision-Date: 2025-10-15 12:15\n" +"POT-Creation-Date: 2025-10-16 14:12+0000\n" +"PO-Revision-Date: 2025-10-16 14:11\n" "Last-Translator: \n" "Language-Team: French\n" "Language: fr_FR\n" @@ -58,7 +58,7 @@ msgstr "Importer des messages via IMAP" msgid "Keys" msgstr "Clés" -#: core/api/serializers.py:1024 +#: core/api/serializers.py:1031 msgid "A mailbox with this local part already exists in this domain." msgstr "Une boîte avec ce préfixe existe déjà dans ce domaine." @@ -743,7 +743,9 @@ msgstr "" "{html: str, text: str, raw: any}" #: core/models.py:1687 -msgid "Type of template (reply, new_message, signature)" +#, fuzzy +#| msgid "Type of template (reply, new_message, signature)" +msgid "Type of template (message, signature)" msgstr "Type de modèle (réponse, nouveau message, signature)" #: core/models.py:1693 diff --git a/src/backend/locale/it_IT/LC_MESSAGES/django.mo b/src/backend/locale/it_IT/LC_MESSAGES/django.mo index 4a7d8db8..54527914 100644 Binary files a/src/backend/locale/it_IT/LC_MESSAGES/django.mo and b/src/backend/locale/it_IT/LC_MESSAGES/django.mo differ diff --git a/src/backend/locale/it_IT/LC_MESSAGES/django.po b/src/backend/locale/it_IT/LC_MESSAGES/django.po index 1d7d067a..e960b491 100644 --- a/src/backend/locale/it_IT/LC_MESSAGES/django.po +++ b/src/backend/locale/it_IT/LC_MESSAGES/django.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: lasuite-messages\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-15 12:16+0000\n" -"PO-Revision-Date: 2025-10-15 12:15\n" +"POT-Creation-Date: 2025-10-16 14:12+0000\n" +"PO-Revision-Date: 2025-10-16 14:11\n" "Last-Translator: \n" "Language-Team: Italian\n" "Language: it_IT\n" @@ -58,7 +58,7 @@ msgstr "" msgid "Keys" msgstr "" -#: core/api/serializers.py:1024 +#: core/api/serializers.py:1031 msgid "A mailbox with this local part already exists in this domain." msgstr "" @@ -721,7 +721,7 @@ msgid "" msgstr "" #: core/models.py:1687 -msgid "Type of template (reply, new_message, signature)" +msgid "Type of template (message, signature)" msgstr "" #: core/models.py:1693 diff --git a/src/backend/locale/nl_NL/LC_MESSAGES/django.mo b/src/backend/locale/nl_NL/LC_MESSAGES/django.mo index 148686e6..d7c741c5 100644 Binary files a/src/backend/locale/nl_NL/LC_MESSAGES/django.mo and b/src/backend/locale/nl_NL/LC_MESSAGES/django.mo differ diff --git a/src/backend/locale/nl_NL/LC_MESSAGES/django.po b/src/backend/locale/nl_NL/LC_MESSAGES/django.po index 07d6f33f..9ab4edad 100644 --- a/src/backend/locale/nl_NL/LC_MESSAGES/django.po +++ b/src/backend/locale/nl_NL/LC_MESSAGES/django.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: lasuite-messages\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-15 12:16+0000\n" -"PO-Revision-Date: 2025-10-15 12:15\n" +"POT-Creation-Date: 2025-10-16 14:12+0000\n" +"PO-Revision-Date: 2025-10-16 14:11\n" "Last-Translator: \n" "Language-Team: Dutch\n" "Language: nl_NL\n" @@ -58,7 +58,7 @@ msgstr "" msgid "Keys" msgstr "" -#: core/api/serializers.py:1024 +#: core/api/serializers.py:1031 msgid "A mailbox with this local part already exists in this domain." msgstr "" @@ -721,7 +721,7 @@ msgid "" msgstr "" #: core/models.py:1687 -msgid "Type of template (reply, new_message, signature)" +msgid "Type of template (message, signature)" msgstr "" #: core/models.py:1693 diff --git a/src/backend/locale/pt_PT/LC_MESSAGES/django.mo b/src/backend/locale/pt_PT/LC_MESSAGES/django.mo index 4186989d..7923b402 100644 Binary files a/src/backend/locale/pt_PT/LC_MESSAGES/django.mo and b/src/backend/locale/pt_PT/LC_MESSAGES/django.mo differ diff --git a/src/backend/locale/pt_PT/LC_MESSAGES/django.po b/src/backend/locale/pt_PT/LC_MESSAGES/django.po index 5c3d90e1..cab781a9 100644 --- a/src/backend/locale/pt_PT/LC_MESSAGES/django.po +++ b/src/backend/locale/pt_PT/LC_MESSAGES/django.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: lasuite-messages\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-15 12:16+0000\n" -"PO-Revision-Date: 2025-10-15 12:15\n" +"POT-Creation-Date: 2025-10-16 14:12+0000\n" +"PO-Revision-Date: 2025-10-16 14:11\n" "Last-Translator: \n" "Language-Team: Portuguese\n" "Language: pt_PT\n" @@ -58,7 +58,7 @@ msgstr "" msgid "Keys" msgstr "" -#: core/api/serializers.py:1024 +#: core/api/serializers.py:1031 msgid "A mailbox with this local part already exists in this domain." msgstr "" @@ -721,7 +721,7 @@ msgid "" msgstr "" #: core/models.py:1687 -msgid "Type of template (reply, new_message, signature)" +msgid "Type of template (message, signature)" msgstr "" #: core/models.py:1693 diff --git a/src/backend/locale/ru_RU/LC_MESSAGES/django.mo b/src/backend/locale/ru_RU/LC_MESSAGES/django.mo index b302f9b9..99491aac 100644 Binary files a/src/backend/locale/ru_RU/LC_MESSAGES/django.mo and b/src/backend/locale/ru_RU/LC_MESSAGES/django.mo differ diff --git a/src/backend/locale/ru_RU/LC_MESSAGES/django.po b/src/backend/locale/ru_RU/LC_MESSAGES/django.po index b3074081..d0a7ef58 100644 --- a/src/backend/locale/ru_RU/LC_MESSAGES/django.po +++ b/src/backend/locale/ru_RU/LC_MESSAGES/django.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: lasuite-messages\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-15 12:16+0000\n" -"PO-Revision-Date: 2025-10-15 12:15\n" +"POT-Creation-Date: 2025-10-16 14:12+0000\n" +"PO-Revision-Date: 2025-10-16 14:11\n" "Last-Translator: \n" "Language-Team: Russian\n" "Language: ru_RU\n" @@ -60,7 +60,7 @@ msgstr "Импорт сообщений IMAP" msgid "Keys" msgstr "Ключи" -#: core/api/serializers.py:1024 +#: core/api/serializers.py:1031 msgid "A mailbox with this local part already exists in this domain." msgstr "Почтовый ящик с этой локальной частью уже существует в этом домене." @@ -746,7 +746,9 @@ msgstr "" "str, raw: any}" #: core/models.py:1687 -msgid "Type of template (reply, new_message, signature)" +#, fuzzy +#| msgid "Type of template (reply, new_message, signature)" +msgid "Type of template (message, signature)" msgstr "Тип шаблона (ответить, новое_сообщение, подпись)" #: core/models.py:1693 diff --git a/src/backend/locale/uk_UA/LC_MESSAGES/django.mo b/src/backend/locale/uk_UA/LC_MESSAGES/django.mo index b9796527..85ac074a 100644 Binary files a/src/backend/locale/uk_UA/LC_MESSAGES/django.mo and b/src/backend/locale/uk_UA/LC_MESSAGES/django.mo differ diff --git a/src/backend/locale/uk_UA/LC_MESSAGES/django.po b/src/backend/locale/uk_UA/LC_MESSAGES/django.po index f6adc226..a826312b 100644 --- a/src/backend/locale/uk_UA/LC_MESSAGES/django.po +++ b/src/backend/locale/uk_UA/LC_MESSAGES/django.po @@ -2,8 +2,8 @@ msgid "" msgstr "" "Project-Id-Version: lasuite-messages\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2025-10-15 12:16+0000\n" -"PO-Revision-Date: 2025-10-15 12:15\n" +"POT-Creation-Date: 2025-10-16 14:12+0000\n" +"PO-Revision-Date: 2025-10-16 14:11\n" "Last-Translator: \n" "Language-Team: Ukrainian\n" "Language: uk_UA\n" @@ -60,7 +60,7 @@ msgstr "Імпорт повідомлень з IMAP" msgid "Keys" msgstr "Ключі" -#: core/api/serializers.py:1024 +#: core/api/serializers.py:1031 msgid "A mailbox with this local part already exists in this domain." msgstr "Поштова скринька з цією локальною частиною вже існує в цьому домені." @@ -742,7 +742,9 @@ msgstr "" "text: str, raw: any}" #: core/models.py:1687 -msgid "Type of template (reply, new_message, signature)" +#, fuzzy +#| msgid "Type of template (reply, new_message, signature)" +msgid "Type of template (message, signature)" msgstr "Тип шаблону (відповідь, нове_повідомлення, підпис)" #: core/models.py:1693 diff --git a/src/frontend/public/locales/common/en-US.json b/src/frontend/public/locales/common/en-US.json index b21cd915..f2cdbfd3 100644 --- a/src/frontend/public/locales/common/en-US.json +++ b/src/frontend/public/locales/common/en-US.json @@ -165,6 +165,7 @@ "Last name": "Last name", "Last name is required.": "Last name is required.", "Last saved {{relativeTime}}": "Last saved {{relativeTime}}", + "Last update: {{timestamp}}": "Last update: {{timestamp}}", "less than a minute ago": "less than a minute ago", "Loading addresses...": "Loading addresses...", "Loading labels...": "Loading labels...", @@ -249,6 +250,7 @@ "Shared mailbox": "Shared mailbox", "Show": "Show", "Show embedded message": "Show embedded message", + "Show logs": "Show logs", "Signature created!": "Signature created!", "Signature deleted!": "Signature deleted!", "Signature updated!": "Signature updated!", @@ -289,8 +291,8 @@ "This description will be used by the AI to automatically assign this label to your messages.": "This description will be used by the AI to automatically assign this label to your messages.", "This email has an attachment": "This email has an attachment", "This message has been deleted.": "This message has been deleted.", - "This message has not been delivered. Last update: {{timestamp}}.": "This message has not been delivered. Last update: {{timestamp}}.", - "This message is being delivered. Last update: {{timestamp}}.": "This message is being delivered. Last update: {{timestamp}}.", + "This message has not been delivered.": "This message has not been delivered.", + "This message is being delivered.": "This message is being delivered.", "This signature is forced": "This signature is forced", "Thread access removed": "Thread access removed", "To": "To", diff --git a/src/frontend/public/locales/common/fr-FR.json b/src/frontend/public/locales/common/fr-FR.json index 35c8a751..6013ddb1 100644 --- a/src/frontend/public/locales/common/fr-FR.json +++ b/src/frontend/public/locales/common/fr-FR.json @@ -165,6 +165,7 @@ "Last name": "Nom", "Last name is required.": "Un nom est requis.", "Last saved {{relativeTime}}": "Dernière sauvegarde {{relativeTime}}", + "Last update: {{timestamp}}": "Dernière mise à jour : {{timestamp}}", "less than a minute ago": "il y a moins d'une minute", "Loading addresses...": "Chargement des adresses...", "Loading labels...": "Chargement des libellés...", @@ -249,6 +250,7 @@ "Shared mailbox": "Boîte partagée", "Show": "Afficher", "Show embedded message": "Afficher le message inclus", + "Show logs": "En savoir plus", "Signature created!": "Signature créée !", "Signature deleted!": "Signature supprimée !", "Signature updated!": "Signature mise à jour !", @@ -289,8 +291,8 @@ "This description will be used by the AI to automatically assign this label to your messages.": "Cette description sera utilisée par l'IA pour assigner automatiquement cette étiquette à vos messages.", "This email has an attachment": "Ce message contient une pièce jointe", "This message has been deleted.": "Ce message a été supprimé.", - "This message has not been delivered. Last update: {{timestamp}}.": "Ce message n'a pas pu être délivré. Dernière mise à jour : {{timestamp}}.", - "This message is being delivered. Last update: {{timestamp}}.": "Ce message est en cours d'envoi. Dernière mise à jour : {{timestamp}}.", + "This message has not been delivered.": "Ce message n'a pas pu être délivré.", + "This message is being delivered.": "Ce message est en cours d'envoi.", "This signature is forced": "Cette signature est forcée", "Thread access removed": "Accès à la conversation supprimé", "To": "À", diff --git a/src/frontend/src/features/api/gen/models/message_recipient.ts b/src/frontend/src/features/api/gen/models/message_recipient.ts index 953c7f42..8182a635 100644 --- a/src/frontend/src/features/api/gen/models/message_recipient.ts +++ b/src/frontend/src/features/api/gen/models/message_recipient.ts @@ -16,6 +16,8 @@ export interface MessageRecipient { /** @nullable */ readonly delivery_status: MessageRecipientDeliveryStatus; /** @nullable */ + readonly delivery_message: string | null; + /** @nullable */ readonly retry_at: string | null; /** @nullable */ readonly delivered_at: string | null; diff --git a/src/frontend/src/features/layouts/components/thread-view/components/thread-message/index.tsx b/src/frontend/src/features/layouts/components/thread-view/components/thread-message/index.tsx index 1aefdf3e..34887036 100644 --- a/src/frontend/src/features/layouts/components/thread-view/components/thread-message/index.tsx +++ b/src/frontend/src/features/layouts/components/thread-view/components/thread-message/index.tsx @@ -55,14 +55,18 @@ export const ThreadMessage = forwardRef( const [textBody,] = MailHelper.extractDriveAttachmentsFromTextBody(message.textBody[0]?.content as string); const getRecipientDeliveryStatus = (recipient: MessageRecipient): ContactChipDeliveryStatus | undefined => { + // If the message has just been sent, it has not delivery status but for the sender it is useful to show that the message is being delivered + if (message.is_sender && recipient.delivery_status === null) { + return {'status': 'delivering', 'timestamp': null, 'message': null}; + } switch (recipient.delivery_status) { case MessageDeliveryStatusChoices.failed: - return {'status': 'undelivered', 'timestamp': recipient.retry_at!}; + return {'status': 'undelivered', 'timestamp': recipient.retry_at, 'message': recipient.delivery_message}; case MessageDeliveryStatusChoices.retry: - return {'status': 'delivering', 'timestamp': recipient.retry_at!}; + return {'status': 'delivering', 'timestamp': recipient.retry_at, 'message': recipient.delivery_message}; case MessageDeliveryStatusChoices.sent: case MessageDeliveryStatusChoices.internal: - return {'status': 'delivered', 'timestamp': recipient.delivered_at!}; + return {'status': 'delivered', 'timestamp': recipient.delivered_at, 'message': recipient.delivery_message}; default: return undefined; } diff --git a/src/frontend/src/features/ui/components/contact-chip/index.tsx b/src/frontend/src/features/ui/components/contact-chip/index.tsx index c5a25e07..1b18ccba 100644 --- a/src/frontend/src/features/ui/components/contact-chip/index.tsx +++ b/src/frontend/src/features/ui/components/contact-chip/index.tsx @@ -10,7 +10,8 @@ import { DateHelper } from "@/features/utils/date-helper"; type DeliveryStatus = 'undelivered' | 'delivering' | 'delivered'; export type ContactChipDeliveryStatus = { status: DeliveryStatus; - timestamp: string; + timestamp: string | null; + message: string | null; } type ContactChipSenderStatus = 'unverified'; @@ -55,16 +56,9 @@ export const ContactChip = ({ contact, status }: ContactChipProps) => { ); } if (status instanceof Object) { - if (status.status === 'undelivered') { + if (['undelivered', 'delivering'].includes(status.status)) { return ( - - {chipContent} - - ) - } - if (status.status === 'delivering') { - return ( - + }> {chipContent} ) @@ -73,3 +67,28 @@ export const ContactChip = ({ contact, status }: ContactChipProps) => { return chipContent; }; + +const DeliveryStatusTooltip = ({ status }: { status: ContactChipDeliveryStatus }) => { + const { t } = useTranslation(); + + return ( +
+ {status.status === 'undelivered' && ( +

{t("This message has not been delivered.")}

+ )} + {status.status === 'delivering' && ( +

{t("This message is being delivered.")}

+ )} + {status.timestamp || status.message && ( +
+ {status.timestamp && ( +

{t("Last update: {{timestamp}}", { timestamp: DateHelper.formatRelativeTime(status.timestamp) })}

+ )} + {status.message && ( +
{t('Show logs')}{status.message}
+ )} +
+ )} +
+ ) +}