Add overflow to SDS Message

This commit is contained in:
nocnico
2025-06-08 13:07:49 +02:00
parent 9f9fc49446
commit 890cf27261
2 changed files with 20 additions and 6 deletions

View File

@@ -132,6 +132,10 @@ export const useMrtStore = create<MrtStore>(
}
case "sds": {
const { sdsMessage } = pageData as SetSdsPageParams;
const maxLen = 60;
const msg = sdsMessage.data.message;
const safeMsg =
typeof msg === "string" && msg.length > maxLen ? msg.slice(0, maxLen) + "…" : msg;
set({
page: "sds",
lines: [
@@ -141,9 +145,17 @@ export const useMrtStore = create<MrtStore>(
textSize: "2",
},
{
textLeft: sdsMessage.data.message,
style: {},
textSize: "1",
textLeft: safeMsg,
style: {
whiteSpace: "normal",
overflow: "hidden",
textOverflow: "ellipsis",
maxWidth: "100%",
width: "100%",
display: "block",
wordBreak: "break-word",
},
textSize: "2",
},
],
});