export default async function fetchData(formData) {
   try {
      const ajaxUrl = window.themeData?.ajaxUrl || "/wp-admin/admin-ajax.php";
      const response = await fetch(ajaxUrl, {
         method: "POST",
         credentials: "same-origin",
         body: formData,
      });

      const data = await response.json();

      return data;
   } catch (error) {
      return { success: false, data: { message: error.message || "Ошибка сети" } };
   }
}
