import { Mail, ExternalLink, Send } from 'lucide-react'; import { personalConfig, getObfuscatedEmail } from '../../config/personal'; import { getTexts } from '../../config/texts'; interface ContactSectionProps { title?: string; subtitle?: string; connectTitle?: string; connectDescription?: string; buttonText?: string; socialTitle?: string; availabilityText?: string; responseTimeLabel?: string; responseTimeValue?: string; preferredContactLabel?: string; preferredContactValue?: string; locationLabel?: string; locationValue?: string; } export default function ContactSection(props: ContactSectionProps = {}) { const texts = getTexts().contact; const { title = texts.title, subtitle = texts.subtitle, connectTitle = texts.connectTitle, connectDescription = texts.connectDescription, buttonText = texts.buttonText, socialTitle = texts.socialTitle, availabilityText = texts.availabilityText, responseTimeLabel = texts.responseTimeLabel, responseTimeValue = texts.responseTimeValue, preferredContactLabel = texts.preferredContactLabel, preferredContactValue = texts.preferredContactValue, locationLabel = texts.locationLabel, locationValue = texts.locationValue, } = props; // Enhanced email handler with better accessibility const handleEmailClick = () => { const email = getEmailAddress(); const subject = encodeURIComponent(texts.emailSubject); const body = encodeURIComponent(texts.emailBody); // Announce action to screen readers const announcement = document.createElement('div'); announcement.setAttribute('aria-live', 'polite'); announcement.setAttribute('class', 'sr-only'); announcement.textContent = texts.emailAnnouncement; document.body.appendChild(announcement); globalThis.location.href = `mailto:${email}?subject=${subject}&body=${body}`; setTimeout(() => { announcement.remove(); }, 1000); }; const getEmailAddress = () => { const parts = ['freelancer', 'sascha-bach', 'de']; return parts[0] + '@' + parts[1] + '.' + parts[2]; }; // Enhanced social link handler with announcements const handleSocialClick = (platform: string, url: string) => { const announcement = document.createElement('div'); announcement.setAttribute('aria-live', 'polite'); announcement.setAttribute('class', 'sr-only'); announcement.textContent = texts.socialAnnouncement.replace('{platform}', platform); document.body.appendChild(announcement); globalThis.open(url, '_blank', 'noopener,noreferrer'); setTimeout(() => { announcement.remove(); }, 1000); }; return (
{/* Section Header */}

{title}

{subtitle}

{/* Skip link for keyboard navigation */}
Skip to contact form
{/* Contact Content Grid */}
{/* Let's Connect Card */}
{/* Hidden description for screen readers */}
This button will open your default email client with a pre-filled message to {getEmailAddress()}
{/* Contact Info Sidebar */} {/* Social Contact Methods */}

{socialTitle}

  • {getObfuscatedEmail()}
  • {personalConfig.social.github.username}
  • {personalConfig.social.linkedin.username}
); }