From d997d119eeb7a5ea9efaca9e875fc022b236f17f Mon Sep 17 00:00:00 2001 From: jbpenrath Date: Thu, 16 Oct 2025 16:21:47 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8(front)=20add=20more=20context=20if?= =?UTF-8?q?=20available=20about=20message=20delivery=20status?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We recently display recipient delivery status tooltip when the message is not yet delivered or in failure. To help user to understand why the message is not delivered, we now display the delivery message if there is one. --- src/backend/core/api/openapi.json | 6 +++ src/backend/core/api/serializers.py | 3 +- .../locale/br_FR/LC_MESSAGES/django.mo | Bin 730 -> 730 bytes .../locale/br_FR/LC_MESSAGES/django.po | 8 ++-- .../locale/de_DE/LC_MESSAGES/django.mo | Bin 480 -> 480 bytes .../locale/de_DE/LC_MESSAGES/django.po | 8 ++-- .../locale/en_US/LC_MESSAGES/django.po | 6 +-- .../locale/es_ES/LC_MESSAGES/django.mo | Bin 484 -> 484 bytes .../locale/es_ES/LC_MESSAGES/django.po | 8 ++-- .../locale/fr_FR/LC_MESSAGES/django.mo | Bin 14131 -> 14131 bytes .../locale/fr_FR/LC_MESSAGES/django.po | 10 +++-- .../locale/it_IT/LC_MESSAGES/django.mo | Bin 481 -> 481 bytes .../locale/it_IT/LC_MESSAGES/django.po | 8 ++-- .../locale/nl_NL/LC_MESSAGES/django.mo | Bin 479 -> 479 bytes .../locale/nl_NL/LC_MESSAGES/django.po | 8 ++-- .../locale/pt_PT/LC_MESSAGES/django.mo | Bin 487 -> 487 bytes .../locale/pt_PT/LC_MESSAGES/django.po | 8 ++-- .../locale/ru_RU/LC_MESSAGES/django.mo | Bin 17678 -> 17678 bytes .../locale/ru_RU/LC_MESSAGES/django.po | 10 +++-- .../locale/uk_UA/LC_MESSAGES/django.mo | Bin 17438 -> 17438 bytes .../locale/uk_UA/LC_MESSAGES/django.po | 10 +++-- src/frontend/public/locales/common/en-US.json | 6 ++- src/frontend/public/locales/common/fr-FR.json | 6 ++- .../api/gen/models/message_recipient.ts | 2 + .../components/thread-message/index.tsx | 10 +++-- .../ui/components/contact-chip/index.tsx | 39 +++++++++++++----- 26 files changed, 99 insertions(+), 57 deletions(-) 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 6890da77e1c159428ea3961084c9866ae3c7f5df..8b8cf17666310353bec528b317bc6c249aed819c 100644 GIT binary patch delta 18 Zcmcb`dW&_!1a>n8LlY}Q!;RCOnE*W31c 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 dc0fb2fbff45bd19297574cbf7f2b974969fcd69..0474429b1e2eb269ff887469b12c3c932f3f206c 100644 GIT binary patch delta 18 ZcmaFB{D67F1a>n8LlY}Q!;RBD838?R1=j!o delta 18 ZcmaFB{D67F1a?yeLnA9g(~Z+T838?K1=s)p 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 cc60205e95452ff1950c5bc05e26fe2c054c6284..af9e0843452c579b03336dc8ee7210e0df07741a 100644 GIT binary patch delta 18 ZcmaFD{DgVJ1a>n8LlY}Q!;RB@838^11>*n! delta 18 ZcmaFD{DgVJ1a?yeLnA9g(~Z-8838@_1>^t# 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 6b40b871db8eb0372887a6864aa60405ea9f3a46..6aa68b51a1be1cf959b5331ab9afeb496c88c7dd 100644 GIT binary patch delta 20 bcmdm-w>fXaMFn;<1w#`nL&MEC6r#ldS9S+p delta 20 bcmdm-w>fXaMFnn8LlY}Q!;RCu7y&(!1=;`r delta 18 ZcmaFJ{E&IV1a?yeLnA9g(~Z-;7y&(t1=|1s 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 148686e61b87cf69c6f9a2feeab26fcc24d2eee1..d7c741c56f33673af8f7f9631244dde56854d6c4 100644 GIT binary patch delta 18 Zcmcc5e4ly31a>n8LlY}Q!;RBD7y&&>1=Iil delta 18 Zcmcc5e4ly31a?yeLnA9g(~Z+T7y&&)1=Rom 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 4186989defb346cda3557138544baf4f12015a36..7923b40236423b24426307ecdd6199c520ca8dfc 100644 GIT binary patch delta 18 ZcmaFP{G55h1a>n8LlY}Q!;RAe7y&+N1?&I- delta 18 ZcmaFP{G55h1a?yeLnA9g(~Z*u7y&+G1?>O; 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 b302f9b9ebab9ec009007f722e3f2197e39edfd1..99491aacd52f3c85cf753a49a23f76bd2d70eae3 100644 GIT binary patch delta 22 dcmeC{V(jZ;+;CBW-AuvI#LCcc^9=lmT0O2VwvK delta 22 dcmbQ&!8osjal=Igc2fmIBP&DG%{LU>lmT0I2V(#L 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}
+ )} +
+ )} +
+ ) +}