Pre luanch plan phase 1 complete

This commit is contained in:
IGNY8 VPS (Salman)
2026-01-05 03:40:39 +00:00
parent 1f2e734ea2
commit e93ea77c2b
60 changed files with 492 additions and 5215 deletions

View File

@@ -10,6 +10,7 @@ import { useNavigate } from 'react-router-dom';
import PageMeta from '../../components/common/PageMeta';
import PageHeader from '../../components/common/PageHeader';
import { useToast } from '../../components/ui/toast/ToastContainer';
import { usePageLoading } from '../../context/PageLoadingContext';
import WorkflowGuide from '../../components/onboarding/WorkflowGuide';
import {
fetchSeedKeywords,
@@ -34,6 +35,7 @@ import Label from '../../components/form/Label';
export default function IndustriesSectorsKeywords() {
const toast = useToast();
const { startLoading, stopLoading } = usePageLoading();
const { activeSite } = useSiteStore();
const { activeSector, loadSectorsForSite } = useSectorStore();
const { pageSize } = usePageSizeStore();
@@ -42,7 +44,6 @@ export default function IndustriesSectorsKeywords() {
// Data state
const [sites, setSites] = useState<Site[]>([]);
const [seedKeywords, setSeedKeywords] = useState<(SeedKeyword & { isAdded?: boolean })[]>([]);
const [loading, setLoading] = useState(true);
const [showContent, setShowContent] = useState(false);
const [selectedIds, setSelectedIds] = useState<string[]>([]);
// Track recently added keywords to preserve their state during reload
@@ -82,14 +83,14 @@ export default function IndustriesSectorsKeywords() {
const loadInitialData = async () => {
try {
setLoading(true);
startLoading('Loading sites...');
const response = await fetchSites();
const activeSites = (response.results || []).filter(site => site.is_active);
setSites(activeSites);
} catch (error: any) {
toast.error(`Failed to load sites: ${error.message}`);
} finally {
setLoading(false);
stopLoading();
}
};
@@ -640,24 +641,6 @@ export default function IndustriesSectorsKeywords() {
};
}, [activeSector, handleAddToWorkflow]);
// Show loading state
if (loading) {
return (
<>
<PageMeta title="Add Keywords" description="Browse and add keywords to your workflow" />
<PageHeader
title="Add Keywords"
badge={{ icon: <BoltIcon />, color: 'blue' }}
/>
<div className="p-6">
<div className="flex items-center justify-center h-64">
<div className="text-gray-500">Loading...</div>
</div>
</div>
</>
);
}
// Show WorkflowGuide if no sites
if (sites.length === 0) {
return (