diff --git a/src/components/help/ContactForm.tsx b/src/components/help/ContactForm.tsx index 383e033..0d09879 100644 --- a/src/components/help/ContactForm.tsx +++ b/src/components/help/ContactForm.tsx @@ -1,19 +1,11 @@ import { useState } from 'react'; -import { ArrowLeft, Upload, X } from 'lucide-react'; +import { ArrowLeft } from 'lucide-react'; import { Button } from '@/components/ui/button'; -import { Input } from '@/components/ui/input'; -import { Textarea } from '@/components/ui/textarea'; -import { Label } from '@/components/ui/label'; -import { - Select, - SelectContent, - SelectItem, - SelectTrigger, - SelectValue, -} from '@/components/ui/select'; import { useToast } from '@/hooks/use-toast'; import { supabase } from '@/integrations/supabase/client'; +import ContactFormFields from './ContactFormFields'; +import ContactFormHeader from './ContactFormHeader'; interface ContactFormProps { onBack: () => void; @@ -29,15 +21,6 @@ const ContactForm = ({ onBack }: ContactFormProps) => { const [loading, setLoading] = useState(false); const { toast } = useToast(); - const motivosContato = [ - 'Dúvida sobre funcionalidade', - 'Problema técnico', - 'Sugestão de melhoria', - 'Reclamação', - 'Elogio', - 'Outros' - ]; - const handleSubmit = async (e: React.FormEvent) => { e.preventDefault(); @@ -75,7 +58,7 @@ const ContactForm = ({ onBack }: ContactFormProps) => { // Salvar contato no banco const { error } = await supabase - .from('contatos' as any) + .from('contatos') .insert({ assunto: formData.assunto, motivo: formData.motivo, @@ -114,119 +97,15 @@ const ContactForm = ({ onBack }: ContactFormProps) => { } }; - const handleFileChange = (e: React.ChangeEvent) => { - const file = e.target.files?.[0]; - if (file) { - // Validar tamanho (max 5MB) - if (file.size > 5 * 1024 * 1024) { - toast({ - title: "Arquivo muito grande", - description: "O arquivo deve ter no máximo 5MB.", - variant: "destructive" - }); - return; - } - setFormData({ ...formData, anexo: file }); - } - }; - - const removeFile = () => { - setFormData({ ...formData, anexo: null }); - }; - return (
-
- -
-

- Você vai receber a resposta no e-mail que cadastrou aqui -

-
-
- -
-
- - setFormData({ ...formData, assunto: e.target.value })} - required - /> -
- -
- - -
- -
- -