Watchlist: Buy button + Intel: Unified techy mobile design
Some checks failed
CI / Frontend Lint & Type Check (push) Has been cancelled
CI / Frontend Build (push) Has been cancelled
CI / Backend Lint (push) Has been cancelled
CI / Backend Tests (push) Has been cancelled
CI / Docker Build (push) Has been cancelled
CI / Security Scan (push) Has been cancelled
Deploy / Build & Push Images (push) Has been cancelled
Deploy / Deploy to Server (push) Has been cancelled
Deploy / Notify (push) Has been cancelled

This commit is contained in:
2025-12-13 14:28:45 +01:00
parent f293df3e23
commit 09fb4e2931
2 changed files with 660 additions and 275 deletions

View File

@ -3,7 +3,8 @@
import { useEffect, useState, useMemo, useCallback } from 'react'
import { useStore } from '@/lib/store'
import { api } from '@/lib/api'
import { CommandCenterLayout } from '@/components/CommandCenterLayout'
import { Sidebar } from '@/components/Sidebar'
import { Toast, useToast } from '@/components/Toast'
import {
Loader2,
TrendingUp,
@ -20,10 +21,24 @@ import {
Sparkles,
BarChart3,
Zap,
Minus
Minus,
Eye,
Gavel,
Target,
X,
Menu,
Settings,
Shield,
LogOut,
Crown,
Coins,
Tag,
ChevronRight,
Filter
} from 'lucide-react'
import clsx from 'clsx'
import Link from 'next/link'
import Image from 'next/image'
// ============================================================================
// TYPES
@ -60,7 +75,7 @@ function getTierLevel(tier: UserTier): number {
const formatPrice = (p: number) => {
if (typeof p !== 'number' || isNaN(p)) return '$0'
return new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' }).format(p)
return new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD', maximumFractionDigits: 0 }).format(p)
}
// ============================================================================
@ -68,7 +83,8 @@ const formatPrice = (p: number) => {
// ============================================================================
export default function IntelPage() {
const { subscription } = useStore()
const { subscription, user, logout, checkAuth } = useStore()
const { toast, showToast, hideToast } = useToast()
const userTier: UserTier = (subscription?.tier as UserTier) || 'scout'
const tierLevel = getTierLevel(userTier)
@ -83,16 +99,25 @@ export default function IntelPage() {
const [total, setTotal] = useState(0)
const [searchQuery, setSearchQuery] = useState('')
const [searchFocused, setSearchFocused] = useState(false)
const [filterType, setFilterType] = useState<'all' | 'tech' | 'geo' | 'budget'>('all')
const [filtersOpen, setFiltersOpen] = useState(false)
const [sortField, setSortField] = useState<SortField>('popularity')
const [sortDirection, setSortDirection] = useState<SortDirection>('asc')
// Mobile Menu
const [menuOpen, setMenuOpen] = useState(false)
// Check auth on mount
useEffect(() => {
checkAuth()
}, [checkAuth])
const loadData = useCallback(async () => {
setLoading(true)
setError(null)
try {
// Fetch multiple pages to get more TLDs (API limit is 100 per request)
const allTlds: TLDData[] = []
let totalRecords = 0
@ -123,7 +148,6 @@ export default function IntelPage() {
allTlds.push(...mapped)
// Stop if we got less than requested (no more data)
if (response.tlds.length < 100) break
}
@ -204,38 +228,207 @@ export default function IntelPage() {
return { lowest, traps, avgRenewal }
}, [tldData])
// Active filters count
const activeFiltersCount = filterType !== 'all' ? 1 : 0
// Mobile Nav
const mobileNavItems = [
{ href: '/terminal/radar', label: 'Radar', icon: Target, active: false },
{ href: '/terminal/market', label: 'Market', icon: Gavel, active: false },
{ href: '/terminal/watchlist', label: 'Watch', icon: Eye, active: false },
{ href: '/terminal/intel', label: 'Intel', icon: TrendingUp, active: true },
]
const tierName = subscription?.tier_name || subscription?.tier || 'Scout'
const TierIcon = tierName === 'Tycoon' ? Crown : tierName === 'Trader' ? TrendingUp : Zap
const drawerNavSections = [
{
title: 'Discover',
items: [
{ href: '/terminal/radar', label: 'Radar', icon: Target },
{ href: '/terminal/market', label: 'Market', icon: Gavel },
{ href: '/terminal/intel', label: 'Intel', icon: TrendingUp },
]
},
{
title: 'Manage',
items: [
{ href: '/terminal/watchlist', label: 'Watchlist', icon: Eye },
{ href: '/terminal/sniper', label: 'Sniper', icon: Target },
]
},
{
title: 'Monetize',
items: [
{ href: '/terminal/yield', label: 'Yield', icon: Coins, isNew: true },
{ href: '/terminal/listing', label: 'For Sale', icon: Tag },
]
}
]
return (
<CommandCenterLayout minimal>
{/* ═══════════════════════════════════════════════════════════════════════ */}
{/* HEADER */}
{/* ═══════════════════════════════════════════════════════════════════════ */}
<section className="pt-6 lg:pt-8 pb-6">
<div className="flex flex-col lg:flex-row lg:items-end lg:justify-between gap-6">
<div className="space-y-3">
<div className="inline-flex items-center gap-2">
<BarChart3 className="w-4 h-4 text-accent" />
<span className="text-[10px] font-mono tracking-wide text-accent">Pricing Analytics</span>
<div className="min-h-screen bg-[#020202]">
{/* Desktop Sidebar */}
<div className="hidden lg:block">
<Sidebar />
</div>
<h1 className="font-display text-[2rem] lg:text-[2.5rem] leading-[1] tracking-[-0.02em]">
{/* Main Content */}
<main className="lg:pl-[240px]">
{/* ═══════════════════════════════════════════════════════════════════════ */}
{/* MOBILE HEADER */}
{/* ═══════════════════════════════════════════════════════════════════════ */}
<header
className="lg:hidden sticky top-0 z-40 bg-[#020202]/95 backdrop-blur-md border-b border-white/[0.08]"
style={{ paddingTop: 'env(safe-area-inset-top)' }}
>
<div className="px-4 py-3">
{/* Top Row */}
<div className="flex items-center justify-between mb-3">
<div className="flex items-center gap-2">
<div className="w-1.5 h-1.5 bg-accent animate-pulse" />
<span className="text-[10px] font-mono tracking-[0.2em] text-accent uppercase">TLD Intel</span>
</div>
<div className="flex items-center gap-2 text-[10px] font-mono text-white/40">
<span>{total} extensions</span>
<span className="text-accent">{stats.traps} risky</span>
</div>
</div>
{/* Stats Grid */}
<div className="grid grid-cols-3 gap-2">
<div className="bg-white/[0.02] border border-white/[0.08] p-2">
<div className="text-lg font-bold text-white tabular-nums">{total}</div>
<div className="text-[9px] font-mono text-white/30 uppercase tracking-wider">TLDs</div>
</div>
<div className="bg-accent/[0.05] border border-accent/20 p-2">
<div className="text-lg font-bold text-accent tabular-nums font-mono">{formatPrice(stats.lowest)}</div>
<div className="text-[9px] font-mono text-accent/60 uppercase tracking-wider">Lowest</div>
</div>
<div className="bg-orange-500/[0.05] border border-orange-500/20 p-2">
<div className="text-lg font-bold text-orange-400 tabular-nums">{stats.traps}</div>
<div className="text-[9px] font-mono text-orange-400/60 uppercase tracking-wider">High Risk</div>
</div>
</div>
</div>
</header>
{/* ═══════════════════════════════════════════════════════════════════════ */}
{/* MOBILE SEARCH & FILTERS */}
{/* ═══════════════════════════════════════════════════════════════════════ */}
<section className="lg:hidden px-4 py-3 border-b border-white/[0.08]">
{/* Search */}
<div className={clsx(
"relative border-2 transition-all duration-200 mb-3",
searchFocused
? "border-accent/50 bg-accent/[0.02]"
: "border-white/[0.08] bg-white/[0.02]"
)}>
<div className="flex items-center">
<Search className={clsx(
"w-4 h-4 ml-3 transition-colors",
searchFocused ? "text-accent" : "text-white/30"
)} />
<input
type="text"
value={searchQuery}
onChange={(e) => setSearchQuery(e.target.value)}
onFocus={() => setSearchFocused(true)}
onBlur={() => setSearchFocused(false)}
placeholder="Search TLDs..."
className="flex-1 bg-transparent px-3 py-3 text-sm text-white placeholder:text-white/20 outline-none font-mono"
/>
{searchQuery && (
<button
onClick={() => setSearchQuery('')}
className="p-3 text-white/30 active:text-white transition-colors"
>
<X className="w-4 h-4" />
</button>
)}
</div>
</div>
{/* Filter Toggle */}
<button
onClick={() => setFiltersOpen(!filtersOpen)}
className={clsx(
"flex items-center justify-between w-full py-2 px-3 border transition-colors",
filtersOpen ? "border-accent/30 bg-accent/[0.05]" : "border-white/[0.08] bg-white/[0.02]"
)}
>
<div className="flex items-center gap-2">
<Filter className="w-4 h-4 text-white/40" />
<span className="text-xs font-mono text-white/60">Filters</span>
{activeFiltersCount > 0 && (
<span className="px-1.5 py-0.5 text-[9px] font-bold bg-accent text-black">{activeFiltersCount}</span>
)}
</div>
<ChevronRight className={clsx("w-4 h-4 text-white/30 transition-transform", filtersOpen && "rotate-90")} />
</button>
{/* Filters Panel */}
{filtersOpen && (
<div className="mt-3 p-3 border border-white/[0.08] bg-white/[0.02] animate-in fade-in slide-in-from-top-2 duration-200">
<div className="text-[9px] font-mono text-white/30 uppercase tracking-wider mb-2">Category</div>
<div className="grid grid-cols-2 gap-2">
{[
{ value: 'all', label: 'All TLDs', icon: null },
{ value: 'tech', label: 'Tech', icon: Zap },
{ value: 'geo', label: 'National', icon: Globe },
{ value: 'budget', label: '<$10', icon: DollarSign },
].map((item) => (
<button
key={item.value}
onClick={() => setFilterType(item.value as typeof filterType)}
className={clsx(
"py-2 text-[10px] font-bold uppercase tracking-wider border flex items-center justify-center gap-1.5 transition-all",
filterType === item.value
? "border-accent bg-accent/10 text-accent"
: "border-white/[0.08] text-white/40"
)}
>
{item.icon && <item.icon className="w-3 h-3" />}
{item.label}
</button>
))}
</div>
</div>
)}
</section>
{/* ═══════════════════════════════════════════════════════════════════════ */}
{/* DESKTOP HEADER */}
{/* ═══════════════════════════════════════════════════════════════════════ */}
<section className="hidden lg:block px-10 pt-10 pb-6">
<div className="flex flex-col lg:flex-row lg:items-end lg:justify-between gap-6">
<div className="space-y-3">
<div className="flex items-center gap-2">
<div className="w-1.5 h-1.5 bg-accent animate-pulse" />
<span className="text-[10px] font-mono tracking-[0.2em] text-accent uppercase">Pricing Analytics</span>
</div>
<h1 className="font-display text-[2.5rem] leading-[1] tracking-[-0.02em]">
<span className="text-white">TLD Intel</span>
<span className="text-white/30 ml-3">{total}</span>
<span className="text-white/30 ml-3 font-mono text-[2rem]">{total}</span>
</h1>
</div>
<div className="flex gap-6 lg:gap-8">
<div className="flex gap-8">
<div className="text-right">
<div className="text-xl font-display text-accent">{formatPrice(stats.lowest)}</div>
<div className="text-[9px] tracking-wide text-white/30 font-mono">Lowest Entry</div>
<div className="text-2xl font-bold text-accent font-mono">{formatPrice(stats.lowest)}</div>
<div className="text-[9px] font-mono text-white/30 uppercase tracking-wider">Lowest Entry</div>
</div>
<div className="text-right">
<div className="text-xl font-display text-amber-400">{stats.traps}</div>
<div className="text-[9px] tracking-wide text-white/30 font-mono">High Risk</div>
<div className="text-2xl font-bold text-orange-400 font-mono">{stats.traps}</div>
<div className="text-[9px] font-mono text-white/30 uppercase tracking-wider">High Risk</div>
</div>
{canSeeRenewal && (
<div className="text-right">
<div className="text-xl font-display text-white">{formatPrice(stats.avgRenewal)}</div>
<div className="text-[9px] tracking-wide text-white/30 font-mono">Avg Renewal</div>
<div className="text-2xl font-bold text-white font-mono">{formatPrice(stats.avgRenewal)}</div>
<div className="text-[9px] font-mono text-white/30 uppercase tracking-wider">Avg Renewal</div>
</div>
)}
</div>
@ -243,15 +436,15 @@ export default function IntelPage() {
</section>
{/* ═══════════════════════════════════════════════════════════════════════ */}
{/* FILTERS */}
{/* DESKTOP FILTERS */}
{/* ═══════════════════════════════════════════════════════════════════════ */}
<section className="pb-6 border-b border-white/[0.08]">
<section className="hidden lg:block px-10 pb-6 border-b border-white/[0.08]">
<div className="flex flex-wrap items-center gap-2">
<button
onClick={() => setFilterType('all')}
className={clsx(
"px-3 py-1.5 text-xs font-medium transition-colors",
filterType === 'all' ? "bg-white/10 text-white" : "text-white/40 hover:text-white/60"
"px-3 py-1.5 text-xs font-mono transition-colors border",
filterType === 'all' ? "bg-white/10 text-white border-white/20" : "text-white/40 border-transparent hover:text-white/60"
)}
>
All TLDs
@ -259,8 +452,8 @@ export default function IntelPage() {
<button
onClick={() => setFilterType('tech')}
className={clsx(
"px-3 py-1.5 text-xs font-medium transition-colors flex items-center gap-1.5",
filterType === 'tech' ? "bg-accent/20 text-accent" : "text-white/40 hover:text-white/60"
"px-3 py-1.5 text-xs font-mono transition-colors flex items-center gap-1.5 border",
filterType === 'tech' ? "bg-accent/20 text-accent border-accent/30" : "text-white/40 border-transparent hover:text-white/60"
)}
>
<Zap className="w-3 h-3" />
@ -269,22 +462,22 @@ export default function IntelPage() {
<button
onClick={() => setFilterType('geo')}
className={clsx(
"px-3 py-1.5 text-xs font-medium transition-colors flex items-center gap-1.5",
filterType === 'geo' ? "bg-white/10 text-white" : "text-white/40 hover:text-white/60"
"px-3 py-1.5 text-xs font-mono transition-colors flex items-center gap-1.5 border",
filterType === 'geo' ? "bg-white/10 text-white border-white/20" : "text-white/40 border-transparent hover:text-white/60"
)}
>
<Globe className="w-3 h-3" />
Geo / National
National
</button>
<button
onClick={() => setFilterType('budget')}
className={clsx(
"px-3 py-1.5 text-xs font-medium transition-colors flex items-center gap-1.5",
filterType === 'budget' ? "bg-white/10 text-white" : "text-white/40 hover:text-white/60"
"px-3 py-1.5 text-xs font-mono transition-colors flex items-center gap-1.5 border",
filterType === 'budget' ? "bg-white/10 text-white border-white/20" : "text-white/40 border-transparent hover:text-white/60"
)}
>
<DollarSign className="w-3 h-3" />
Budget {'<'}$10
{'<'}$10
</button>
<div className="flex-1" />
@ -295,15 +488,15 @@ export default function IntelPage() {
type="text"
value={searchQuery}
onChange={(e) => setSearchQuery(e.target.value)}
placeholder="Search TLDs..."
className="bg-[#050505] border border-white/10 pl-9 pr-4 py-2 text-sm text-white placeholder:text-white/25 outline-none focus:border-accent/40 w-48 lg:w-64"
placeholder="Search..."
className="bg-white/[0.02] border border-white/10 pl-9 pr-4 py-2 text-sm text-white placeholder:text-white/25 outline-none focus:border-accent/40 w-48 font-mono"
/>
</div>
<button
onClick={handleRefresh}
disabled={refreshing}
className="p-2 text-white/30 hover:text-white transition-colors"
className="p-2 text-white/30 hover:text-white transition-colors border border-white/10"
>
<RefreshCw className={clsx("w-4 h-4", refreshing && "animate-spin")} />
</button>
@ -311,108 +504,88 @@ export default function IntelPage() {
</section>
{/* ═══════════════════════════════════════════════════════════════════════ */}
{/* TABLE */}
{/* CONTENT */}
{/* ═══════════════════════════════════════════════════════════════════════ */}
<section className="py-6">
<section className="px-4 lg:px-10 py-4 pb-28 lg:pb-10">
{loading ? (
<div className="flex items-center justify-center py-20">
<Loader2 className="w-6 h-6 text-accent animate-spin" />
</div>
) : error ? (
<div className="text-center py-16">
<div className="w-14 h-14 mx-auto bg-red-500/10 border border-red-500/20 flex items-center justify-center mb-4">
<AlertTriangle className="w-6 h-6 text-red-400" />
</div>
<p className="text-red-400 text-sm mb-2">{error}</p>
<button onClick={handleRefresh} className="text-white/40 text-xs hover:text-white">Try again</button>
<div className="text-center py-16 border border-dashed border-white/[0.08]">
<AlertTriangle className="w-8 h-8 text-rose-400 mx-auto mb-3" />
<p className="text-rose-400 text-sm font-mono mb-2">{error}</p>
<button onClick={handleRefresh} className="text-white/40 text-xs font-mono hover:text-white">Try again</button>
</div>
) : filteredData.length === 0 ? (
<div className="text-center py-16">
<div className="w-14 h-14 mx-auto bg-white/[0.02] border border-white/10 flex items-center justify-center mb-4">
<Search className="w-6 h-6 text-white/20" />
</div>
<p className="text-white/40 text-sm">No TLDs found</p>
<div className="text-center py-16 border border-dashed border-white/[0.08]">
<Search className="w-8 h-8 text-white/10 mx-auto mb-3" />
<p className="text-white/40 text-sm font-mono">No TLDs found</p>
</div>
) : (
<div className="overflow-x-auto">
<table className="w-full min-w-[900px]">
<thead>
<tr className="text-xs text-white/40 border-b border-white/[0.06]">
<th className="text-left py-3 px-4 font-medium">
<>
{/* TLD List */}
<div className="space-y-px bg-white/[0.04] border border-white/[0.08]">
{/* Desktop Header */}
<div className="hidden lg:grid grid-cols-[1fr_100px_100px_80px_80px_60px_40px] gap-4 px-3 py-2 text-[10px] font-mono text-white/40 uppercase tracking-wider border-b border-white/[0.08]">
<button onClick={() => handleSort('tld')} className="flex items-center gap-1 hover:text-white/60">
Extension
{sortField === 'tld' && (sortDirection === 'asc' ? <ChevronUp className="w-3 h-3" /> : <ChevronDown className="w-3 h-3" />)}
</button>
</th>
<th className="text-right py-3 px-4 font-medium">
<button onClick={() => handleSort('price')} className="flex items-center gap-1 ml-auto hover:text-white/60">
Reg. Price
<button onClick={() => handleSort('price')} className="flex items-center gap-1 justify-end hover:text-white/60">
Reg
{sortField === 'price' && (sortDirection === 'asc' ? <ChevronUp className="w-3 h-3" /> : <ChevronDown className="w-3 h-3" />)}
</button>
</th>
<th className="text-right py-3 px-4 font-medium">
<button
onClick={() => canSeeRenewal && handleSort('renewal')}
className={clsx("flex items-center gap-1 ml-auto", canSeeRenewal ? "hover:text-white/60" : "opacity-50 cursor-not-allowed")}
className={clsx("flex items-center gap-1 justify-end", canSeeRenewal ? "hover:text-white/60" : "opacity-50")}
>
Renewal
{!canSeeRenewal && <Lock className="w-3 h-3" />}
{sortField === 'renewal' && (sortDirection === 'asc' ? <ChevronUp className="w-3 h-3" /> : <ChevronDown className="w-3 h-3" />)}
</button>
</th>
<th className="text-center py-3 px-4 font-medium">
<button onClick={() => handleSort('change')} className="flex items-center gap-1 mx-auto hover:text-white/60">
1y Trend
<button onClick={() => handleSort('change')} className="flex items-center gap-1 justify-center hover:text-white/60">
1y
{sortField === 'change' && (sortDirection === 'asc' ? <ChevronUp className="w-3 h-3" /> : <ChevronDown className="w-3 h-3" />)}
</button>
</th>
<th className="text-center py-3 px-4 font-medium">
<button
onClick={() => canSee3yTrend && handleSort('change3y')}
className={clsx("flex items-center gap-1 mx-auto", canSee3yTrend ? "hover:text-white/60" : "opacity-50 cursor-not-allowed")}
className={clsx("flex items-center gap-1 justify-center", canSee3yTrend ? "hover:text-white/60" : "opacity-50")}
>
3y Trend
3y
{!canSee3yTrend && <Lock className="w-3 h-3" />}
</button>
</th>
<th className="text-center py-3 px-4 font-medium">Risk</th>
<th className="text-right py-3 px-4 font-medium"></th>
</tr>
</thead>
<tbody>
<div className="text-center">Risk</div>
<div></div>
</div>
{filteredData.map((tld) => {
const isTrap = (tld.min_renewal_price || 0) > (tld.min_price || 1) * 1.5
const trend = tld.price_change_1y || 0
const trend3y = tld.price_change_3y || 0
return (
<tr key={tld.tld} className="group border-b border-white/[0.04] hover:bg-white/[0.02]">
<td className="py-3 px-4">
<Link href={`/terminal/intel/${tld.tld}`} className="font-mono font-medium text-white hover:text-accent transition-colors">
.{tld.tld}
</Link>
</td>
<td className="py-3 px-4 text-right font-mono text-white">
{formatPrice(tld.min_price)}
</td>
<td className="py-3 px-4 text-right">
{canSeeRenewal ? (
<div className="flex items-center justify-end gap-1.5">
<span className={clsx("font-mono", isTrap ? "text-amber-400" : "text-white/50")}>
{formatPrice(tld.min_renewal_price)}
</span>
{isTrap && <AlertTriangle className="w-3.5 h-3.5 text-amber-400" />}
<div key={tld.tld} className="bg-[#020202] hover:bg-white/[0.02] transition-all group">
{/* Mobile Row */}
<Link
href={`/terminal/intel/${tld.tld}`}
className="lg:hidden block p-3"
>
<div className="flex items-center justify-between mb-2">
<div className="flex items-center gap-3">
<div className="w-8 h-8 bg-white/[0.02] border border-white/[0.06] flex items-center justify-center">
<Globe className="w-4 h-4 text-white/40" />
</div>
) : (
<span className="text-white/20 flex items-center gap-1 justify-end">
<Lock className="w-3 h-3" />
Trader+
</span>
)}
</td>
<td className="py-3 px-4 text-center">
<span className="text-sm font-bold text-white font-mono">.{tld.tld}</span>
</div>
<div className="text-right">
<div className="text-sm font-bold text-accent font-mono">{formatPrice(tld.min_price)}</div>
<div className="text-[9px] font-mono text-white/30">register</div>
</div>
</div>
<div className="flex items-center justify-between text-[10px] font-mono">
<div className="flex items-center gap-3">
<span className={clsx(
"inline-flex items-center gap-1 text-xs font-mono px-2 py-0.5",
"px-1.5 py-0.5 flex items-center gap-1",
trend > 5 ? "text-orange-400 bg-orange-400/10" :
trend < -5 ? "text-accent bg-accent/10" :
"text-white/40 bg-white/5"
@ -420,11 +593,54 @@ export default function IntelPage() {
{trend > 0 ? <TrendingUp className="w-3 h-3" /> : trend < 0 ? <TrendingDown className="w-3 h-3" /> : <Minus className="w-3 h-3" />}
{Math.abs(trend)}%
</span>
</td>
<td className="py-3 px-4 text-center">
<div className="w-12 h-1 bg-white/10">
<div className={clsx(
"h-full",
tld.risk_level === 'low' ? "w-1/3 bg-accent" :
tld.risk_level === 'medium' ? "w-2/3 bg-amber-400" :
"w-full bg-red-400"
)} />
</div>
</div>
<ChevronRight className="w-4 h-4 text-white/20" />
</div>
</Link>
{/* Desktop Row */}
<div className="hidden lg:grid grid-cols-[1fr_100px_100px_80px_80px_60px_40px] gap-4 items-center px-3 py-3">
<Link href={`/terminal/intel/${tld.tld}`} className="font-mono font-bold text-white hover:text-accent transition-colors">
.{tld.tld}
</Link>
<div className="text-right font-mono text-white">{formatPrice(tld.min_price)}</div>
<div className="text-right">
{canSeeRenewal ? (
<div className="flex items-center justify-end gap-1">
<span className={clsx("font-mono", isTrap ? "text-amber-400" : "text-white/50")}>
{formatPrice(tld.min_renewal_price)}
</span>
{isTrap && <AlertTriangle className="w-3 h-3 text-amber-400" />}
</div>
) : (
<span className="text-white/20 flex items-center gap-1 justify-end text-[10px]">
<Lock className="w-3 h-3" />
</span>
)}
</div>
<div className="text-center">
<span className={clsx(
"inline-flex items-center gap-0.5 text-xs font-mono px-1.5 py-0.5",
trend > 5 ? "text-orange-400 bg-orange-400/10" :
trend < -5 ? "text-accent bg-accent/10" :
"text-white/40 bg-white/5"
)}>
{trend > 0 ? <TrendingUp className="w-3 h-3" /> : trend < 0 ? <TrendingDown className="w-3 h-3" /> : <Minus className="w-3 h-3" />}
{Math.abs(trend)}%
</span>
</div>
<div className="text-center">
{canSee3yTrend ? (
<span className={clsx(
"inline-flex items-center gap-1 text-xs font-mono px-2 py-0.5",
"inline-flex items-center gap-0.5 text-xs font-mono px-1.5 py-0.5",
trend3y > 10 ? "text-orange-400 bg-orange-400/10" :
trend3y < -10 ? "text-accent bg-accent/10" :
"text-white/40 bg-white/5"
@ -435,9 +651,9 @@ export default function IntelPage() {
) : (
<span className="text-white/20"></span>
)}
</td>
<td className="py-3 px-4 text-center">
<div className="w-16 h-1.5 mx-auto bg-white/10 overflow-hidden" title={tld.risk_reason || 'Standard risk'}>
</div>
<div className="flex justify-center">
<div className="w-10 h-1 bg-white/10">
<div className={clsx(
"h-full",
tld.risk_level === 'low' ? "w-1/3 bg-accent" :
@ -445,44 +661,190 @@ export default function IntelPage() {
"w-full bg-red-400"
)} />
</div>
</td>
<td className="py-3 px-4 text-right">
</div>
<Link
href={`/terminal/intel/${tld.tld}`}
className="opacity-0 group-hover:opacity-100 inline-flex items-center gap-1 text-xs text-white/50 hover:text-white transition-all"
className="opacity-0 group-hover:opacity-100 flex justify-end"
>
<ArrowRight className="w-4 h-4" />
<ArrowRight className="w-4 h-4 text-white/30 hover:text-accent" />
</Link>
</td>
</tr>
</div>
</div>
)
})}
</tbody>
</table>
</div>
{/* Upgrade CTA */}
{userTier === 'scout' && (
<div className="mt-6 p-6 border border-white/[0.08] bg-white/[0.02] text-center">
<Sparkles className="w-6 h-6 text-accent mx-auto mb-3" />
<h3 className="text-sm font-bold text-white mb-1">Unlock Full Intel</h3>
<p className="text-xs font-mono text-white/40 mb-4">
See renewal prices, traps & 3-year trends
</p>
<Link
href="/pricing"
className="inline-flex items-center gap-2 px-4 py-2 bg-accent text-black text-xs font-bold uppercase tracking-wider hover:bg-white transition-colors"
>
<Sparkles className="w-3 h-3" />
Upgrade
</Link>
</div>
)}
</>
)}
</section>
{/* ═══════════════════════════════════════════════════════════════════════ */}
{/* UPGRADE CTA */}
{/* MOBILE BOTTOM NAV */}
{/* ═══════════════════════════════════════════════════════════════════════ */}
{userTier === 'scout' && (
<section className="py-8 border-t border-white/[0.06]">
<div className="text-center max-w-md mx-auto">
<Sparkles className="w-8 h-8 text-accent mx-auto mb-4" />
<h3 className="font-display text-xl text-white mb-2">Unlock Full Intel</h3>
<p className="text-sm text-white/40 mb-6">
See renewal prices, identify traps, and access 3-year price history with Trader or Tycoon.
<nav
className="lg:hidden fixed bottom-0 left-0 right-0 z-50 bg-[#020202] border-t border-white/[0.08]"
style={{ paddingBottom: 'env(safe-area-inset-bottom)' }}
>
<div className="flex items-stretch h-14">
{mobileNavItems.map((item) => (
<Link
key={item.href}
href={item.href}
className={clsx(
"flex-1 flex flex-col items-center justify-center gap-0.5 relative transition-colors",
item.active ? "text-accent" : "text-white/40 active:text-white/80"
)}
>
{item.active && (
<div className="absolute top-0 left-1/2 -translate-x-1/2 w-10 h-0.5 bg-accent" />
)}
<item.icon className="w-5 h-5" />
<span className="text-[9px] font-mono uppercase tracking-wider">{item.label}</span>
</Link>
))}
<button
onClick={() => setMenuOpen(true)}
className="flex-1 flex flex-col items-center justify-center gap-0.5 text-white/40 active:text-white/80 transition-all"
>
<Menu className="w-5 h-5" />
<span className="text-[9px] font-mono uppercase tracking-wider">Menu</span>
</button>
</div>
</nav>
{/* ═══════════════════════════════════════════════════════════════════════ */}
{/* MOBILE DRAWER */}
{/* ═══════════════════════════════════════════════════════════════════════ */}
{menuOpen && (
<div className="lg:hidden fixed inset-0 z-[100]">
<div
className="absolute inset-0 bg-black/80 animate-in fade-in duration-200"
onClick={() => setMenuOpen(false)}
/>
<div className="absolute top-0 right-0 bottom-0 w-[80%] max-w-[300px] bg-[#0A0A0A] border-l border-white/[0.08] animate-in slide-in-from-right duration-300 flex flex-col" style={{ paddingTop: 'env(safe-area-inset-top)', paddingBottom: 'env(safe-area-inset-bottom)' }}>
<div className="flex items-center justify-between p-4 border-b border-white/[0.08]">
<div className="flex items-center gap-3">
<Image src="/pounce-puma.png" alt="Pounce" width={28} height={28} className="object-contain" />
<div>
<h2 className="text-sm font-bold text-white tracking-wider">POUNCE</h2>
<p className="text-[9px] text-white/40 font-mono uppercase tracking-widest">Terminal v1.0</p>
</div>
</div>
<button
onClick={() => setMenuOpen(false)}
className="w-8 h-8 flex items-center justify-center border border-white/10 text-white/60 hover:text-white active:bg-white/5 transition-all"
>
<X className="w-4 h-4" />
</button>
</div>
<div className="flex-1 overflow-y-auto py-4">
{drawerNavSections.map((section) => (
<div key={section.title} className="mb-4">
<div className="flex items-center gap-2 px-4 mb-2">
<div className="w-1 h-3 bg-accent" />
<span className="text-[9px] font-bold text-white/30 uppercase tracking-[0.2em]">{section.title}</span>
</div>
<div>
{section.items.map((item: any) => (
<Link
key={item.href}
href={item.href}
onClick={() => setMenuOpen(false)}
className="flex items-center gap-3 px-4 py-2.5 text-white/60 active:text-white active:bg-white/[0.03] transition-colors border-l-2 border-transparent active:border-accent"
>
<item.icon className="w-4 h-4 text-white/30" />
<span className="text-sm font-medium flex-1">{item.label}</span>
{item.isNew && (
<span className="px-1.5 py-0.5 text-[8px] font-bold bg-accent text-black">NEW</span>
)}
</Link>
))}
</div>
</div>
))}
<div className="pt-3 border-t border-white/[0.08] mx-4">
<Link
href="/terminal/settings"
onClick={() => setMenuOpen(false)}
className="flex items-center gap-3 py-2.5 text-white/50 active:text-white transition-colors"
>
<Settings className="w-4 h-4" />
<span className="text-sm font-medium">Settings</span>
</Link>
{user?.is_admin && (
<Link
href="/admin"
onClick={() => setMenuOpen(false)}
className="flex items-center gap-3 py-2.5 text-amber-500/70 active:text-amber-400 transition-colors"
>
<Shield className="w-4 h-4" />
<span className="text-sm font-medium">Admin</span>
</Link>
)}
</div>
</div>
<div className="p-4 bg-white/[0.02] border-t border-white/[0.08]">
<div className="flex items-center gap-3 mb-3">
<div className="w-8 h-8 bg-accent/10 border border-accent/20 flex items-center justify-center">
<TierIcon className="w-4 h-4 text-accent" />
</div>
<div className="flex-1 min-w-0">
<p className="text-sm font-bold text-white truncate">
{user?.name || user?.email?.split('@')[0] || 'User'}
</p>
<p className="text-[9px] font-mono text-white/40 uppercase tracking-wider">{tierName}</p>
</div>
</div>
{tierName === 'Scout' && (
<Link
href="/pricing"
className="inline-flex items-center gap-2 px-6 py-3 bg-white text-black font-semibold hover:bg-white/90 transition-colors"
onClick={() => setMenuOpen(false)}
className="flex items-center justify-center gap-2 w-full py-2.5 bg-accent text-black text-xs font-bold uppercase tracking-wider active:scale-[0.98] transition-all mb-2"
>
Upgrade Now
<Sparkles className="w-3 h-3" />
Upgrade
</Link>
</div>
</section>
)}
</CommandCenterLayout>
<button
onClick={() => { logout(); setMenuOpen(false) }}
className="flex items-center justify-center gap-2 w-full py-2 border border-white/10 text-white/40 text-[10px] font-mono uppercase tracking-wider active:bg-white/5 transition-all"
>
<LogOut className="w-3 h-3" />
Sign out
</button>
</div>
</div>
</div>
)}
</main>
{toast && <Toast message={toast.message} type={toast.type} onClose={hideToast} />}
</div>
)
}

View File

@ -455,6 +455,17 @@ export default function WatchlistPage() {
{/* Actions */}
<div className="flex gap-2">
{domain.is_available ? (
<a
href={`https://www.namecheap.com/domains/registration/results/?domain=${domain.name}`}
target="_blank"
rel="noopener noreferrer"
className="flex-1 py-2.5 bg-accent text-black text-[10px] font-bold uppercase tracking-wider flex items-center justify-center gap-1.5"
>
<ExternalLink className="w-3 h-3" />
Register
</a>
) : (
<button
onClick={() => handleToggleNotify(domain.id, domain.notify_on_available)}
disabled={togglingNotifyId === domain.id}
@ -474,6 +485,7 @@ export default function WatchlistPage() {
)}
Alert
</button>
)}
<button
onClick={() => handleRefresh(domain.id)}
@ -579,6 +591,17 @@ export default function WatchlistPage() {
{/* Actions */}
<div className="flex items-center gap-1 shrink-0 opacity-50 group-hover:opacity-100 transition-opacity">
{domain.is_available && (
<a
href={`https://www.namecheap.com/domains/registration/results/?domain=${domain.name}`}
target="_blank"
rel="noopener noreferrer"
className="h-7 px-3 bg-accent text-black text-xs font-bold flex items-center gap-1.5 hover:bg-white transition-colors"
>
Register
<ExternalLink className="w-3 h-3" />
</a>
)}
<button
onClick={() => handleRefresh(domain.id)}
disabled={refreshingId === domain.id}