mirror of
https://github.com/documenso/documenso.git
synced 2026-07-25 01:15:49 +10:00
138d663c25
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.
33 lines
789 B
TypeScript
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;
|