'use client'; import React, { useState, useEffect } from 'react'; interface ObfuscatedEmailProps { email: string; className?: string; children?: React.ReactNode; } /** * A component that helps protect email addresses from simple spambots. * It uses client-side mounting to render the actual email address, * making it harder for static crawlers to harvest. */ export default function ObfuscatedEmail({ email, className = '', children }: ObfuscatedEmailProps) { const [mounted, setMounted] = useState(false); useEffect(() => { setMounted(true); }, []); if (!mounted) { // Show a placeholder or obscured version during SSR return ( ); } // Once mounted on the client, render the real mailto link return ( {children || email} ); }