"use client"; import { useState } from "react"; import { useRouter } from "next/navigation"; const RESULT_LIMIT = 10; const RESULT_OPTIONS = [10, 25, 50, 100]; export function ApifyEmptySearch({ query, planLimit }: { query: string; planLimit: number }) { const router = useRouter(); const [maxResults, setMaxResults] = useState(RESULT_LIMIT); const [busy, setBusy] = useState(false); const [message, setMessage] = useState(""); const [error, setError] = useState(false); async function importFromApify() { setBusy(true); setMessage(""); try { const response = await fetch("/api/ads/import-apify", { method: "POST", headers: { "content-type": "application/json" }, body: JSON.stringify({ searchTerm: query, maxResults, }) }); const data = await response.json().catch(() => ({})); if (!response.ok) throw new Error(data.error || "APIFY_INGEST_FAILED"); setError(false); setMessage(`${data.imported} reklam işlendi. Sonuçlar yenileniyor…`); router.refresh(); } catch (caught) { setError(true); setMessage(caught instanceof Error ? caught.message : "Apify içe aktarması başarısız oldu."); } finally { setBusy(false); } } return (

“{query}” için kayıtlı reklam bulunamadı

Bu arama önce WinningHunter veritabanını kontrol eder. Yeni Meta reklamlarını Apify üzerinden getirip aynı aramaya ekleyebilirsiniz.

Apify · Plan limiti: {planLimit || "erişim yok"} reklam · Kullanılan kayıt kadar API kredisi

{message &&

{message}

}
); }