diff --git a/cannaiq/src/pages/IntelligenceBrands.tsx b/cannaiq/src/pages/IntelligenceBrands.tsx index ef6f2a25..5b2b54c0 100644 --- a/cannaiq/src/pages/IntelligenceBrands.tsx +++ b/cannaiq/src/pages/IntelligenceBrands.tsx @@ -9,7 +9,6 @@ import { MapPin, Package, DollarSign, - RefreshCw, Search, TrendingUp, BarChart3, @@ -100,35 +99,60 @@ export function IntelligenceBrands() {
{/* Header */} -
+

Brands Intelligence

Brand penetration and pricing analytics across markets

-
- - - +
+ {/* State Selector */} + + + {/* Page Navigation */} +
+ + + +
@@ -180,51 +204,32 @@ export function IntelligenceBrands() { {/* Top Brands Chart */}
-
-

- - Top 10 Brands by Store Count -

- -
+

+ + Top 10 Brands by Store Count +

- {topBrands.map((brand, idx) => ( -
- {idx + 1}. - - {brand.brandName} - -
-
+ {topBrands.map((brand) => { + const barWidth = Math.min((brand.storeCount / maxStoreCount) * 100, 100); + return ( +
+ + {brand.brandName} + +
+
+
+
+
+ + {brand.storeCount} +
- - {brand.storeCount} stores - -
- ))} + ); + })}
diff --git a/cannaiq/src/pages/IntelligencePricing.tsx b/cannaiq/src/pages/IntelligencePricing.tsx index ffcaaf57..6c720e7a 100644 --- a/cannaiq/src/pages/IntelligencePricing.tsx +++ b/cannaiq/src/pages/IntelligencePricing.tsx @@ -8,7 +8,6 @@ import { Building2, MapPin, Package, - RefreshCw, TrendingUp, TrendingDown, BarChart3, @@ -87,56 +86,60 @@ export function IntelligencePricing() {
{/* Header */} -
+

Pricing Intelligence

Price distribution and trends by category

-
+
+ {/* State Selector */} - - - + + {/* Page Navigation */} +
+ + + +
diff --git a/cannaiq/src/pages/IntelligenceStores.tsx b/cannaiq/src/pages/IntelligenceStores.tsx index 6a098c08..427fb728 100644 --- a/cannaiq/src/pages/IntelligenceStores.tsx +++ b/cannaiq/src/pages/IntelligenceStores.tsx @@ -8,7 +8,6 @@ import { Building2, DollarSign, Package, - RefreshCw, Search, Clock, Activity, @@ -34,12 +33,19 @@ export function IntelligenceStores() { const [stores, setStores] = useState([]); const [loading, setLoading] = useState(true); const [searchTerm, setSearchTerm] = useState(''); - const [localStates, setLocalStates] = useState([]); + const [availableStates, setAvailableStates] = useState([]); useEffect(() => { loadStores(); }, [selectedState]); + useEffect(() => { + // Load available states from orchestrator API + api.getOrchestratorStates().then(data => { + setAvailableStates(data.states?.map((s: any) => s.state) || []); + }).catch(console.error); + }, []); + const loadStores = async () => { try { setLoading(true); @@ -47,12 +53,7 @@ export function IntelligenceStores() { state: stateParam, limit: 500, }); - const storeList = data.stores || []; - setStores(storeList); - - // Extract unique states from response for dropdown counts - const uniqueStates = [...new Set(storeList.map((s: StoreActivity) => s.state))].filter(Boolean).sort() as string[]; - setLocalStates(uniqueStates); + setStores(data.stores || []); } catch (error) { console.error('Failed to load stores:', error); } finally { @@ -110,35 +111,60 @@ export function IntelligenceStores() {
{/* Header */} -
+

Store Activity

Per-store SKU counts, snapshots, and crawl frequency

-
- - - +
+ {/* State Selector */} + + + {/* Page Navigation */} +
+ + + +