feat: polish reporting templates and shared controls

This commit is contained in:
hectorzhao
2026-07-15 16:31:49 +08:00
parent 28fb8e9038
commit a7a4e8d9f6
21 changed files with 488 additions and 119 deletions
+11
View File
@@ -0,0 +1,11 @@
const LEADING_SMS_SIGNATURE = /^【[^】]+】/;
export function formatSmsSignature(name?: string | null) {
const innerName = (name ?? '').trim().replace(/^[【\[]+|[】\]]+$/g, '').trim();
return innerName ? `${innerName}` : '';
}
export function replaceLeadingSmsSignature(content: string, signatureName?: string | null) {
const body = content.replace(LEADING_SMS_SIGNATURE, '');
return `${formatSmsSignature(signatureName)}${body}`;
}