Files
documenso/packages/email/template-components/template-custom-message-body.tsx
T
ephraimduncan 138d663c25 chore: merge main, resolve biome formatting conflicts
Merge origin/main into feat/external-2fa-codes. Resolve formatting
conflicts caused by biome rollout; preserve both feature streams:
PR's external 2FA token + signing-session 2FA proof additions plus
main's RateLimit/RecipientExpired/signingReminders/date-auto-insert.

In complete-document-with-token.ts, drop the duplicate early
field-fetching block introduced when main moved that logic later
with date auto-insert support; keep the EXTERNAL_TWO_FACTOR_AUTH
check using derivedRecipientActionAuth.
2026-05-12 11:46:11 +00:00

33 lines
789 B
TypeScript

import React from 'react';
export type TemplateCustomMessageBodyProps = {
text?: string;
};
export const TemplateCustomMessageBody = ({ text }: TemplateCustomMessageBodyProps) => {
if (!text) {
return null;
}
const normalized = text
.trim()
.replace(/\r\n?/g, '\n')
.replace(/\n\s*\n+/g, '\n\n')
.replace(/\n{2,}/g, '\n\n');
const paragraphs = normalized.split('\n\n');
return paragraphs.map((paragraph, i) => (
<p key={`p-${i}`} className="whitespace-pre-line break-words font-sans text-base text-slate-400">
{paragraph.split('\n').map((line, j) => (
<React.Fragment key={`line-${i}-${j}`}>
{j > 0 && <br />}
{line}
</React.Fragment>
))}
</p>
));
};
export default TemplateCustomMessageBody;