main
Some checks failed
UI Deploy (Next-Auth Support) 🎨 / build-and-deploy (push) Has been cancelled

This commit is contained in:
Harun CAN
2026-03-23 14:15:07 +03:00
parent 823d11f88d
commit 863d8ed3d9
2 changed files with 7 additions and 0 deletions

View File

@@ -260,6 +260,9 @@ export default function TrendsPage() {
if (trend.source) {
params.set('source', trend.source);
}
if (trend.url) {
params.set('sourceUrl', trend.url);
}
router.push(`/generate?${params.toString()}`);
};

View File

@@ -52,6 +52,7 @@ export function GenerateWizard() {
const [trendDescription, setTrendDescription] = useState("");
const [trendKeywords, setTrendKeywords] = useState<string[]>([]);
const [trendSource, setTrendSource] = useState("");
const [sourceUrl, setSourceUrl] = useState("");
const [selectedNiche, setSelectedNiche] = useState("");
const [selectedPlatforms, setSelectedPlatforms] = useState<string[]>([]);
const [isGenerating, setIsGenerating] = useState(false);
@@ -76,10 +77,12 @@ export function GenerateWizard() {
const descParam = searchParams.get('description');
const keywordsParam = searchParams.get('keywords');
const sourceParam = searchParams.get('source');
const sourceUrlParam = searchParams.get('sourceUrl');
if (topicParam) setTopic(decodeURIComponent(topicParam));
if (descParam) setTrendDescription(decodeURIComponent(descParam));
if (sourceParam) setTrendSource(sourceParam);
if (sourceUrlParam) setSourceUrl(decodeURIComponent(sourceUrlParam));
if (keywordsParam) {
try {
const parsed = JSON.parse(keywordsParam);
@@ -199,6 +202,7 @@ export function GenerateWizard() {
try {
const payload = {
topic,
sourceUrl: sourceUrl || undefined,
description: trendDescription || undefined,
keywords: trendKeywords.length > 0 ? trendKeywords : undefined,
niche: selectedNiche,