import { motion } from "framer-motion"; import { useLanguage } from "@/contexts/LanguageContext"; import { Mail, Github, Send, Share2, Briefcase } from "lucide-react"; import { Card, CardContent } from "@/components/ui/card"; import { Button } from "@/components/ui/button"; import { Input } from "@/components/ui/input"; import { Textarea } from "@/components/ui/textarea"; import { useState } from "react"; export const ContactSection = () => { const { t } = useLanguage(); const [formData, setFormData] = useState({ name: "", email: "", subject: "", message: "", }); const contacts = [ { icon: , label: t("contact.email"), value: "contact@apommier.com", href: "mailto:contact@apommier.com", }, { icon: , label: t("contact.github"), value: "kinou-p", href: "https://github.com/kinou-p", }, { icon: , label: "Malt", value: "Alexandre Pommier", href: "https://www.malt.fr/profile/alexandrepommier", }, ]; const handleInputChange = (e: React.ChangeEvent) => { const { name, value } = e.target; setFormData(prev => ({ ...prev, [name]: value })); }; const handleSubmit = (e: React.FormEvent) => { e.preventDefault(); // Créer un lien mailto avec les données du formulaire const subject = encodeURIComponent(formData.subject || "Contact depuis le portfolio"); const body = encodeURIComponent( `Nom: ${formData.name}\nEmail: ${formData.email}\n\nMessage:\n${formData.message}` ); window.location.href = `mailto:contact@apommier.com?subject=${subject}&body=${body}`; }; const handleShare = async () => { const shareData = { title: "Portfolio d'Alexandre Pommier", text: "Découvrez le portfolio d'Alexandre Pommier, étudiant développeur à 42", url: window.location.href, }; try { if (navigator.share) { await navigator.share(shareData); } else { // Fallback : copier l'URL dans le presse-papiers await navigator.clipboard.writeText(window.location.href); // Vous pouvez ajouter ici une notification toast pour informer l'utilisateur alert("Lien copié dans le presse-papiers !"); } } catch (error) { console.log("Erreur lors du partage:", error); } }; return (

{t("contact.title")}

{t("contact.subtitle")}

{/* Informations de contact */}

Restons en contact

{contacts.map((contact, index) => (
{contact.icon}

{contact.label}

{contact.value}

))} {/* Bouton de partage */}
{/* Formulaire de contact */}

Envoyez-moi un message