"use client"; import { useState } from "react"; import { useTranslation } from "react-i18next"; import { motion } from "framer-motion"; import { MessageCircle, Mail, Phone, MapPin, Send, Loader2 } from "lucide-react"; import toast, { Toaster } from "react-hot-toast"; import { submitReport } from "../utils/api"; import AuthService from "../services/AuthService"; export default function SupportPage() { const { t, i18n } = useTranslation(); const [subject, setSubject] = useState(""); const [body, setBody] = useState(""); const [isSubmitting, setIsSubmitting] = useState(false); const handleSubmit = async (e) => { e.preventDefault(); if (!subject.trim() || !body.trim()) { toast.error(t("support.fillAllFields")); return; } if (!AuthService.isAuthenticated()) { toast.error(t("auth.loginRequired")); return; } setIsSubmitting(true); try { await submitReport(subject, body); toast.success(t("support.submittedSuccess")); setSubject(""); setBody(""); } catch (error) { toast.error(t("support.submitError")); } finally { setIsSubmitting(false); } }; return (
{t("support.hereToHelp")}
{t("support.email")}
support@sweethome.com
{t("support.phone")}
+963 11 234 5678
{t("support.address")}
{t("support.addressValue")}