From 0175a6817edc57e4b35070553f713ce2f94e44a2 Mon Sep 17 00:00:00 2001 From: Kelly Date: Sat, 13 Dec 2025 00:17:58 -0700 Subject: [PATCH] fix: Fix chain badges and table styling in IntelligenceStores MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Add whitespace-nowrap to badges to prevent text wrapping - Add border to chain badges for consistency - Update table styling to match Workers/Tasks pages: - Uppercase headers with proper tracking - Consistent padding and text sizes - Right-align numeric columns (SKUs, Snapshots) - Purple Dashboard button matching Workers page style - Increase table max-height for better visibility 🤖 Generated with [Claude Code](https://claude.com/claude-code) --- cannaiq/src/pages/IntelligenceStores.tsx | 84 +++++++++++++----------- 1 file changed, 46 insertions(+), 38 deletions(-) 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)} +