"use server"

import { contactFormSchema, ContactFormValues } from "@/lib/schemas"

export async function submitContactForm(data: ContactFormValues) {
    const result = contactFormSchema.safeParse(data)

    if (!result.success) {
        return { success: false, error: "Geçersiz form verileri." }
    }

    // Simulate email sending or DB insertion
    await new Promise((resolve) => setTimeout(resolve, 1000))

    // In a real app, you would use Resend or Nodemailer here


    return { success: true, message: "Mesajınız başarıyla gönderildi." }
}
