Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions packages/web/public/i18n/locales/be-BY/ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@
},
"hops": {
"direct": "Direct",
"label": "Number of hops",
"text": "Number of hops: {{value}}"
"label": "Hops Away",
"text": "Hops Away: {{value}}"
},
"lastHeard": {
"label": "Last heard",
Expand Down
4 changes: 2 additions & 2 deletions packages/web/public/i18n/locales/cs-CZ/ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@
},
"hops": {
"direct": "Přímý",
"label": "Number of hops",
"text": "Number of hops: {{value}}"
"label": "Hops Away",
"text": "Hops Away: {{value}}"
},
"lastHeard": {
"label": "Naposledy slyšen",
Expand Down
4 changes: 2 additions & 2 deletions packages/web/public/i18n/locales/en/ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -152,8 +152,8 @@
},
"hops": {
"direct": "Direct",
"label": "Number of hops",
"text": "Number of hops: {{value}}"
"label": "Hops Away",
"text": "Hops Away: {{value}}"
},
"lastHeard": {
"label": "Last heard",
Expand Down
4 changes: 2 additions & 2 deletions packages/web/public/i18n/locales/es-ES/ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@
},
"hops": {
"direct": "Directo",
"label": "Number of hops",
"text": "Number of hops: {{value}}"
"label": "Hops Away",
"text": "Hops Away: {{value}}"
},
"lastHeard": {
"label": "Última escucha",
Expand Down
4 changes: 2 additions & 2 deletions packages/web/public/i18n/locales/hu-HU/ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@
},
"hops": {
"direct": "Közvetlen",
"label": "Number of hops",
"text": "Number of hops: {{value}}"
"label": "Hops Away",
"text": "Hops Away: {{value}}"
},
"lastHeard": {
"label": "Utoljára hallott",
Expand Down
4 changes: 2 additions & 2 deletions packages/web/public/i18n/locales/ja-JP/ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@
},
"hops": {
"direct": "直接",
"label": "Number of hops",
"text": "Number of hops: {{value}}"
"label": "Hops Away",
"text": "Hops Away: {{value}}"
},
"lastHeard": {
"label": "最後の通信",
Expand Down
4 changes: 2 additions & 2 deletions packages/web/public/i18n/locales/nl-NL/ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@
},
"hops": {
"direct": "Direct",
"label": "Number of hops",
"text": "Number of hops: {{value}}"
"label": "Hops Away",
"text": "Hops Away: {{value}}"
},
"lastHeard": {
"label": "Laatst gehoord",
Expand Down
4 changes: 2 additions & 2 deletions packages/web/public/i18n/locales/pl-PL/ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@
},
"hops": {
"direct": "Bezpośrednio",
"label": "Number of hops",
"text": "Number of hops: {{value}}"
"label": "Hops Away",
"text": "Hops Away: {{value}}"
},
"lastHeard": {
"label": "Aktywność",
Expand Down
4 changes: 2 additions & 2 deletions packages/web/public/i18n/locales/pt-BR/ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@
},
"hops": {
"direct": "Direto",
"label": "Number of hops",
"text": "Number of hops: {{value}}"
"label": "Hops Away",
"text": "Hops Away: {{value}}"
},
"lastHeard": {
"label": "Visto pela última vez",
Expand Down
4 changes: 2 additions & 2 deletions packages/web/public/i18n/locales/pt-PT/ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@
},
"hops": {
"direct": "Direto",
"label": "Number of hops",
"text": "Number of hops: {{value}}"
"label": "Hops Away",
"text": "Hops Away: {{value}}"
},
"lastHeard": {
"label": "Último recebido",
Expand Down
4 changes: 2 additions & 2 deletions packages/web/public/i18n/locales/ru-RU/ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@
},
"hops": {
"direct": "Прямой",
"label": "Number of hops",
"text": "Number of hops: {{value}}"
"label": "Hops Away",
"text": "Hops Away: {{value}}"
},
"lastHeard": {
"label": "Последний раз слышен",
Expand Down
4 changes: 2 additions & 2 deletions packages/web/public/i18n/locales/tr-TR/ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@
},
"hops": {
"direct": "Doğrudan",
"label": "Number of hops",
"text": "Number of hops: {{value}}"
"label": "Hops Away",
"text": "Hops Away: {{value}}"
},
"lastHeard": {
"label": "Son duyulma",
Expand Down
4 changes: 2 additions & 2 deletions packages/web/public/i18n/locales/uk-UA/ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@
},
"hops": {
"direct": "Direct",
"label": "Number of hops",
"text": "Number of hops: {{value}}"
"label": "Hops Away",
"text": "Hops Away: {{value}}"
},
"lastHeard": {
"label": "Last heard",
Expand Down
4 changes: 2 additions & 2 deletions packages/web/public/i18n/locales/zh-CN/ui.json
Original file line number Diff line number Diff line change
Expand Up @@ -166,8 +166,8 @@
},
"hops": {
"direct": "直频",
"label": "Number of hops",
"text": "Number of hops: {{value}}"
"label": "Hops Away",
"text": "Hops Away: {{value}}"
},
"lastHeard": {
"label": "最后听到",
Expand Down
File renamed without changes
31 changes: 20 additions & 11 deletions packages/web/src/components/PageComponents/Messages/MessageItem.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -193,6 +193,24 @@ export const MessageItem = ({ message }: MessageItemProps) => {
const isOnPrimaryChannel = message.channel === Types.ChannelNumber.Primary; // Use the enum
const shouldShowStatusIcon = isSender && isOnPrimaryChannel;

const messageMetadata = useMemo(() => {
if (message.hops != null) {
return (
<div className="text-xs text-slate-500 dark:text-slate-200 whitespace-pre-wrap break-words">
{t("hops.text", { value: message.hops })}
</div>
);
}
if (message.rxSnr != null && message.rxRssi != null) {
return (
<div className="text-xs text-slate-500 dark:text-slate-200 whitespace-pre-wrap break-words">
SNR: {message.rxSnr}, RSSI: {message.rxRssi}
</div>
);
}
return null;
}, [message.hops, message.rxSnr, message.rxRssi, t]);

const messageItemWrapperClass = cn(
"group w-full py-2 relative list-none",
"rounded-md",
Expand Down Expand Up @@ -256,20 +274,11 @@ export const MessageItem = ({ message }: MessageItemProps) => {
</div>

{message?.message && (
<div className="text-sm text-slate-800 dark:text-slate-200 whitespace-pre-wrap break-words">
<div className="text-sm text-slate-800 dark:text-slate-200 whitespace-pre-wrap wrap-break-words">
{message.message}
</div>
)}
{(message.hops && (
<div className="text-xs text-slate-500 dark:text-slate-200 whitespace-pre-wrap break-words">
{t("hops.text", { value: message.hops })}
</div>
)) ||
(message.rxSnr && message.rxRssi && (
<div className="text-xs text-slate-500 dark:text-slate-200 whitespace-pre-wrap break-words">
SNR: {message.rxSnr}, RSSI: {message.rxRssi}
</div>
))}
{messageMetadata}
</div>
</div>
{/* Actions Menu Placeholder */}
Expand Down