This commit is contained in:
Timo Knuth
2026-01-16 14:41:42 +01:00
parent 2879fd0d8e
commit 2dec18fc97
7 changed files with 861 additions and 80 deletions

View File

@@ -20,9 +20,10 @@ export function ObfuscatedMailto({ email, className, children }: ObfuscatedMailt
setIsMounted(true);
}, []);
// Before hydration, render as plain text/span to avoid Cloudflare manipulation
// Before hydration, render as obfuscated text to avoid Cloudflare manipulation
if (!isMounted) {
return <span className={className}>{children || email}</span>;
const obfuscatedEmail = email.replace('@', ' [at] ').replace(/\./g, ' [dot] ');
return <span className={className}>{children || obfuscatedEmail}</span>;
}
// After hydration, render as a proper mailto link