diff --git a/cannaiq/src/pages/IntelligenceStores.tsx b/cannaiq/src/pages/IntelligenceStores.tsx index 6c9acd49..123b36ea 100644 --- a/cannaiq/src/pages/IntelligenceStores.tsx +++ b/cannaiq/src/pages/IntelligenceStores.tsx @@ -82,16 +82,28 @@ export function IntelligenceStores() { }; const getCrawlFrequencyBadge = (hours: number | null) => { + const baseClasses = "inline-flex items-center px-2 py-0.5 rounded text-xs font-medium whitespace-nowrap"; if (hours === null) { - return Unknown; + return Unknown; } if (hours <= 4) { - return High ({hours}h); + return High ({hours}h); } if (hours <= 12) { - return Medium ({hours}h); + return Medium ({hours}h); } - return Low ({hours}h); + return Low ({hours}h); + }; + + const getChainBadge = (chainName: string | null) => { + if (!chainName) { + return -; + } + return ( + + {chainName} + + ); }; if (loading) { @@ -232,22 +244,22 @@ export function IntelligenceStores() { {/* Stores Table */} -
-
- - - - - - - - - - - +
+
+
StoreLocationChainSKUsSnapshotsLast CrawlFrequencyActions
+ + + + + + + + + + - + {filteredStores.length === 0 ? ( navigate(`/stores/list/${store.id}`)} > - - - - - - - -
StoreLocationChainSKUsSnapshotsLast CrawlFrequencyActions
@@ -258,39 +270,35 @@ export function IntelligenceStores() { filteredStores.map((store) => (
- {store.name} + + {store.name} - {store.city}, {store.state} + + {store.city}, {store.state} - {store.chainName ? ( - {store.chainName} - ) : ( - - - )} + + {getChainBadge(store.chainName)} - {(store.skuCount || 0).toLocaleString()} + + {(store.skuCount || 0).toLocaleString()} - {(store.snapshotCount || 0).toLocaleString()} + + {(store.snapshotCount || 0).toLocaleString()} - + + {formatTimeAgo(store.lastCrawl)} + {getCrawlFrequencyBadge(store.crawlFrequencyHours)} +