generated from fahricansecer/boilerplate-fe
main
Some checks failed
UI Deploy (Next-Auth Support) 🎨 / build-and-deploy (push) Has been cancelled
Some checks failed
UI Deploy (Next-Auth Support) 🎨 / build-and-deploy (push) Has been cancelled
This commit is contained in:
@@ -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()}`);
|
||||
};
|
||||
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user