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) {
|
if (trend.source) {
|
||||||
params.set('source', trend.source);
|
params.set('source', trend.source);
|
||||||
}
|
}
|
||||||
|
if (trend.url) {
|
||||||
|
params.set('sourceUrl', trend.url);
|
||||||
|
}
|
||||||
router.push(`/generate?${params.toString()}`);
|
router.push(`/generate?${params.toString()}`);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -52,6 +52,7 @@ export function GenerateWizard() {
|
|||||||
const [trendDescription, setTrendDescription] = useState("");
|
const [trendDescription, setTrendDescription] = useState("");
|
||||||
const [trendKeywords, setTrendKeywords] = useState<string[]>([]);
|
const [trendKeywords, setTrendKeywords] = useState<string[]>([]);
|
||||||
const [trendSource, setTrendSource] = useState("");
|
const [trendSource, setTrendSource] = useState("");
|
||||||
|
const [sourceUrl, setSourceUrl] = useState("");
|
||||||
const [selectedNiche, setSelectedNiche] = useState("");
|
const [selectedNiche, setSelectedNiche] = useState("");
|
||||||
const [selectedPlatforms, setSelectedPlatforms] = useState<string[]>([]);
|
const [selectedPlatforms, setSelectedPlatforms] = useState<string[]>([]);
|
||||||
const [isGenerating, setIsGenerating] = useState(false);
|
const [isGenerating, setIsGenerating] = useState(false);
|
||||||
@@ -76,10 +77,12 @@ export function GenerateWizard() {
|
|||||||
const descParam = searchParams.get('description');
|
const descParam = searchParams.get('description');
|
||||||
const keywordsParam = searchParams.get('keywords');
|
const keywordsParam = searchParams.get('keywords');
|
||||||
const sourceParam = searchParams.get('source');
|
const sourceParam = searchParams.get('source');
|
||||||
|
const sourceUrlParam = searchParams.get('sourceUrl');
|
||||||
|
|
||||||
if (topicParam) setTopic(decodeURIComponent(topicParam));
|
if (topicParam) setTopic(decodeURIComponent(topicParam));
|
||||||
if (descParam) setTrendDescription(decodeURIComponent(descParam));
|
if (descParam) setTrendDescription(decodeURIComponent(descParam));
|
||||||
if (sourceParam) setTrendSource(sourceParam);
|
if (sourceParam) setTrendSource(sourceParam);
|
||||||
|
if (sourceUrlParam) setSourceUrl(decodeURIComponent(sourceUrlParam));
|
||||||
if (keywordsParam) {
|
if (keywordsParam) {
|
||||||
try {
|
try {
|
||||||
const parsed = JSON.parse(keywordsParam);
|
const parsed = JSON.parse(keywordsParam);
|
||||||
@@ -199,6 +202,7 @@ export function GenerateWizard() {
|
|||||||
try {
|
try {
|
||||||
const payload = {
|
const payload = {
|
||||||
topic,
|
topic,
|
||||||
|
sourceUrl: sourceUrl || undefined,
|
||||||
description: trendDescription || undefined,
|
description: trendDescription || undefined,
|
||||||
keywords: trendKeywords.length > 0 ? trendKeywords : undefined,
|
keywords: trendKeywords.length > 0 ? trendKeywords : undefined,
|
||||||
niche: selectedNiche,
|
niche: selectedNiche,
|
||||||
|
|||||||
Reference in New Issue
Block a user