From eda676265d0eebee446d12b696153521ba90b5f3 Mon Sep 17 00:00:00 2001 From: "yves.gugger" Date: Wed, 10 Dec 2025 15:47:12 +0100 Subject: [PATCH] fix: Make Public TLD Pricing table 1:1 identical to Command Center MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit CHANGES: 1. Sparkline: Now uses exact same SVG polyline implementation - Upward trend: orange polyline - Downward trend: accent polyline - Neutral: horizontal line 2. Risk Badge: Now shows dot + text label (like Command Center) - 'Stable', 'Renewal trap', etc. visible on desktop - Width changed from 80px → 130px 3. Actions column: Width changed from 40px → 80px 4. Pagination: Simplified to match Command Center styling - Removed icons from buttons - Uses tabular-nums for page counter Both tables now render identically with same: - Column widths - Sparkline SVGs - Risk badges with text - Button styling --- frontend/src/app/tld-pricing/page.tsx | 113 +++++++++++++++----------- 1 file changed, 66 insertions(+), 47 deletions(-) diff --git a/frontend/src/app/tld-pricing/page.tsx b/frontend/src/app/tld-pricing/page.tsx index 2185ed8..deab65d 100644 --- a/frontend/src/app/tld-pricing/page.tsx +++ b/frontend/src/app/tld-pricing/page.tsx @@ -8,8 +8,6 @@ import { useStore } from '@/lib/store' import { api } from '@/lib/api' import { TrendingUp, - TrendingDown, - Minus, ChevronRight, ChevronLeft, Search, @@ -55,31 +53,37 @@ interface PaginationData { has_more: boolean } -// Sparkline component +// Sparkline component - matching Command Center exactly function Sparkline({ trend }: { trend: number }) { const isPositive = trend > 0 - const isNegative = trend < 0 - - // Generate simple sparkline points - const points = Array.from({ length: 8 }, (_, i) => { - const baseY = 50 - const variance = isPositive ? -trend * 3 : isNegative ? -trend * 3 : 5 - return `${i * 14},${baseY + (Math.random() * variance - variance / 2) * (i / 7)}` - }).join(' ') + const isNeutral = trend === 0 return ( -
- - +
+ + {isNeutral ? ( + + ) : isPositive ? ( + + ) : ( + + )}
) @@ -90,7 +94,7 @@ export default function TldPricingPage() { const [tlds, setTlds] = useState([]) const [trending, setTrending] = useState([]) const [loading, setLoading] = useState(true) - const [pagination, setPagination] = useState({ total: 0, limit: 25, offset: 0, has_more: false }) + const [pagination, setPagination] = useState({ total: 0, limit: 50, offset: 0, has_more: false }) // Search & Sort state const [searchQuery, setSearchQuery] = useState('') @@ -150,6 +154,28 @@ export default function TldPricingPage() { } } + // Risk badge - matching Command Center exactly + const getRiskBadge = (tld: TldData) => { + const level = tld.risk_level || 'low' + const reason = tld.risk_reason || 'Stable' + return ( + + + {reason} + + ) + } + // Get renewal trap indicator const getRenewalTrap = (tld: TldData) => { if (!tld.min_renewal_price || !tld.min_registration_price) return null @@ -348,7 +374,7 @@ export default function TldPricingPage() {
- {/* TLD Table using PremiumTable */} + {/* TLD Table using PremiumTable - matching Command Center exactly */} tld.tld} @@ -387,7 +413,7 @@ export default function TldPricingPage() { render: (tld, idx) => { const showData = isAuthenticated || (page === 0 && idx === 0) if (!showData) { - return
+ return
} return }, @@ -473,30 +499,25 @@ export default function TldPricingPage() { key: 'risk', header: 'Risk', align: 'center', - width: '80px', - hideOnMobile: true, + width: '130px', render: (tld, idx) => { const showData = isAuthenticated || (page === 0 && idx === 0) if (!showData) { - return + return ( + + + Hidden + + ) } - return ( -
- -
- ) + return getRiskBadge(tld) }, }, { - key: 'action', + key: 'actions', header: '', align: 'right', - width: '40px', + width: '80px', render: () => ( ), @@ -506,29 +527,27 @@ export default function TldPricingPage() { {/* Pagination */} {!loading && pagination.total > pagination.limit && ( -
+
- + Page {currentPage} of {totalPages}
)}