diff --git a/components/GoogleAdsGenerator.tsx b/components/GoogleAdsGenerator.tsx index 6837420..20106ea 100644 --- a/components/GoogleAdsGenerator.tsx +++ b/components/GoogleAdsGenerator.tsx @@ -51,6 +51,8 @@ export default function GoogleAdsGenerator() { const [isMagicThinking, setIsMagicThinking] = useState(false); const [isEnhancing, setIsEnhancing] = useState(false); + const [isEnhancingAudience, setIsEnhancingAudience] = useState(false); + const [isEnhancingIndustry, setIsEnhancingIndustry] = useState(false); const [progressMessage, setProgressMessage] = useState(""); const [progressIndex, setProgressIndex] = useState(0); @@ -323,6 +325,36 @@ export default function GoogleAdsGenerator() { } }; + const handleEnhanceAudience = async () => { + if (!targetAudience.trim()) return; + setIsEnhancingAudience(true); + setError(null); + try { + const result = await modelAdapter.enhancePrompt(targetAudience, selectedProvider, selectedModel); + if (result.success && result.data) setTargetAudience(result.data); + else setError(result.error || "Failed to enhance audience"); + } catch (err) { + setError(err instanceof Error ? err.message : "Audience enhancement failed"); + } finally { + setIsEnhancingAudience(false); + } + }; + + const handleEnhanceIndustry = async () => { + if (!industry.trim()) return; + setIsEnhancingIndustry(true); + setError(null); + try { + const result = await modelAdapter.enhancePrompt(industry, selectedProvider, selectedModel); + if (result.success && result.data) setIndustry(result.data); + else setError(result.error || "Failed to enhance industry"); + } catch (err) { + setError(err instanceof Error ? err.message : "Industry enhancement failed"); + } finally { + setIsEnhancingIndustry(false); + } + }; + const handleCopy = async () => { const content = googleAdsResult?.rawContent || magicWandResult?.rawContent; if (content) { @@ -1023,7 +1055,23 @@ export default function GoogleAdsGenerator() {
- +
+ + +
- +
+ + +