"use client"; import { useState, useEffect } from 'react'; import { motion } from 'framer-motion'; import { Mail, Phone, MapPin, Send, Github, Linkedin, Twitter } from 'lucide-react'; import { useToast } from '@/components/Toast'; const Contact = () => { const [mounted, setMounted] = useState(false); const { showEmailSent, showEmailError } = useToast(); useEffect(() => { setMounted(true); }, []); const [formData, setFormData] = useState({ name: '', email: '', subject: '', message: '' }); const [isSubmitting, setIsSubmitting] = useState(false); const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); setIsSubmitting(true); try { const response = await fetch('/api/email', { method: 'POST', headers: { 'Content-Type': 'application/json', }, body: JSON.stringify({ name: formData.name, email: formData.email, subject: formData.subject, message: formData.message, }), }); if (response.ok) { showEmailSent(formData.email); setFormData({ name: '', email: '', subject: '', message: '' }); } else { const errorData = await response.json(); showEmailError(errorData.error || 'Unbekannter Fehler'); } } catch (error) { console.error('Error sending email:', error); showEmailError('Netzwerkfehler beim Senden der E-Mail'); } finally { setIsSubmitting(false); } }; const handleChange = (e: React.ChangeEvent) => { setFormData({ ...formData, [e.target.name]: e.target.value }); }; const contactInfo = [ { icon: Mail, title: 'Email', value: 'contact@dki.one', href: 'mailto:contact@dki.one' }, { icon: Phone, title: 'Phone', value: '+49 123 456 789', href: 'tel:+49123456789' }, { icon: MapPin, title: 'Location', value: 'Osnabrück, Germany', href: '#' } ]; const socialLinks = [ { icon: Github, href: 'https://github.com/Denshooter', label: 'GitHub' }, { icon: Linkedin, href: 'https://linkedin.com/in/dkonkol', label: 'LinkedIn' }, { icon: Twitter, href: 'https://twitter.com/dkonkol', label: 'Twitter' } ]; if (!mounted) { return null; } return (
{/* Section Header */}

Get In Touch

Have a project in mind or want to collaborate? I would love to hear from you!

{/* Contact Information */}

Let's Connect

I'm always open to discussing new opportunities, interesting projects, or just having a chat about technology and innovation.

{/* Contact Details */}
{contactInfo.map((info, index) => (

{info.title}

{info.value}

))}
{/* Social Links */}

Follow Me

{socialLinks.map((social) => ( ))}
{/* Contact Form */}

Send Message