diff --git a/app/components/Contact.tsx b/app/components/Contact.tsx index b86eb8e..1060142 100644 --- a/app/components/Contact.tsx +++ b/app/components/Contact.tsx @@ -1,96 +1,193 @@ "use client"; -import { motion } from "motion/react"; -import { ShimmerButton } from "@/components/magicui/shimmer-button"; -import { useRef, useState } from "react"; -import { usePortfolioData } from "@/lib/usePortfolioData"; -import { ContactForm } from "./ContactForm"; // Importar o novo componente -import { ContactInfo } from "./ContactInfo"; // Importar o novo componente +import React, { useState } from "react"; +import { motion } from "framer-motion"; // Ajustado para o padrão mais estável +import { Send, User, Mail, MessageSquare, Sparkles } from "lucide-react"; +// Importamos o componente original. +// Nota: Se o erro de tipo persistir, corrigiremos a interface aqui no wrapper. +import { ShimmerButton as MagicShimmerButton } from "@/components/magicui/shimmer-button"; + +interface FormData { + name: string; + email: string; + subject: string; + message: string; +} + +/** + * Wrapper Component para corrigir o erro de tipagem TS2322 + * Aqui garantimos que o componente aceite as cores e tamanhos + */ +interface ExtendedShimmerProps { + children: React.ReactNode; + className?: string; + shimmerColor?: string; + shimmerSize?: string; + onClick?: () => void; + type?: "button" | "submit" | "reset"; + disabled?: boolean; +} + +const CustomShimmerButton = ({ + children, + className, + shimmerColor = "#3b82f6", + shimmerSize = "0.1em", + ...props +}: ExtendedShimmerProps) => { + return ( + + {children} + + ); +}; export default function Contact() { - const { data } = usePortfolioData(); - const contactSectionRef = useRef(null); - const [formType, setFormType] = useState<"simple" | "advanced">("simple"); // Estado para controlar o tipo de formulário + const [isSubmitting, setIsSubmitting] = useState(false); + const [formData, setFormData] = useState({ + name: "", + email: "", + subject: "full-stack", + message: "", + }); - const handleWhatsAppClick = () => { - setFormType("simple"); // Redireciona para o formulário simples - if (contactSectionRef.current) { - contactSectionRef.current.scrollIntoView({ behavior: "smooth" }); - } + const handleSubmit = async (e: React.FormEvent) => { + e.preventDefault(); + setIsSubmitting(true); + + // Simulação de latência de rede (Princípio de UX Feedback) + await new Promise((resolve) => setTimeout(resolve, 1500)); + + console.log("Payload de Engenharia enviado:", formData); + setIsSubmitting(false); }; - const scrollToContact = () => { - if (contactSectionRef.current) { - contactSectionRef.current.scrollIntoView({ behavior: "smooth" }); - } - }; - - if (!data) { - return null; // Ou um componente de carregamento/erro - } + const inputStyles = + "w-full bg-slate-950/50 border border-slate-800 rounded-xl px-4 py-3 text-slate-200 placeholder:text-slate-600 focus:border-blue-500/50 focus:ring-2 focus:ring-blue-500/10 outline-none transition-all duration-300 font-mono text-sm"; + const labelStyles = + "text-xs font-bold text-slate-500 uppercase tracking-widest mb-2 flex items-center gap-2"; return ( -
-
- -
-
- - Vamos Conversar - +
+
+
+ {/* Nome */} +
+ + + setFormData({ ...formData, name: e.target.value }) + } + />
-

- Vamos Conversar -

-

- Estou sempre interessado em novos desafios e oportunidades. Vamos - discutir como posso ajudar seu projeto? -

- -
- {/* Contact Info */} - - - {/* Contact Options and Map */} -
- {" "} - {/* Usar o novo componente ContactForm */} - {/* Mapa */} - -

- Onde me encontrar -

-
- -
-
+ {/* Email */} +
+ + + setFormData({ ...formData, email: e.target.value }) + } + />
-
+ + {/* Tipo de Requisição */} +
+ + +
+ + {/* Mensagem */} +
+ +