'use client' import { useEffect, useState } from 'react' import { Header } from '@/components/Header' import { Footer } from '@/components/Footer' import { useStore } from '@/lib/store' import { api } from '@/lib/api' import { Zap, Clock, TrendingUp, ExternalLink, Filter, Search, Flame, Timer, DollarSign, Users, ArrowUpRight, ChevronRight, Lock, BarChart3, Target, Sparkles, } from 'lucide-react' import Link from 'next/link' import clsx from 'clsx' interface Auction { domain: string platform: string platform_url: string current_bid: number currency: string num_bids: number end_time: string time_remaining: string buy_now_price: number | null reserve_met: boolean | null traffic: number | null age_years: number | null tld: string affiliate_url: string } interface Opportunity { auction: Auction analysis: { estimated_value: number current_bid: number value_ratio: number potential_profit: number opportunity_score: number recommendation: string } } const PLATFORMS = ['All', 'GoDaddy', 'Sedo', 'NameJet', 'SnapNames', 'DropCatch'] export default function AuctionsPage() { const { isAuthenticated, checkAuth, isLoading: authLoading } = useStore() const [auctions, setAuctions] = useState([]) const [opportunities, setOpportunities] = useState([]) const [hotAuctions, setHotAuctions] = useState([]) const [endingSoon, setEndingSoon] = useState([]) const [loading, setLoading] = useState(true) const [activeTab, setActiveTab] = useState<'all' | 'opportunities' | 'ending'>('all') // Filters const [searchQuery, setSearchQuery] = useState('') const [selectedPlatform, setSelectedPlatform] = useState('All') const [maxBid, setMaxBid] = useState('') useEffect(() => { checkAuth() loadData() }, [checkAuth]) const loadData = async () => { setLoading(true) try { const [auctionsData, hotData, endingData] = await Promise.all([ api.getAuctions(), api.getHotAuctions(), api.getEndingSoonAuctions(), ]) setAuctions(auctionsData.auctions || []) setHotAuctions(hotData || []) setEndingSoon(endingData || []) // Load opportunities only for authenticated users if (isAuthenticated) { try { const oppData = await api.getAuctionOpportunities() setOpportunities(oppData.opportunities || []) } catch (e) { console.error('Failed to load opportunities:', e) } } } catch (error) { console.error('Failed to load auction data:', error) } finally { setLoading(false) } } const formatCurrency = (value: number) => { return new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD', minimumFractionDigits: 0, maximumFractionDigits: 0, }).format(value) } const filteredAuctions = auctions.filter(auction => { if (searchQuery && !auction.domain.toLowerCase().includes(searchQuery.toLowerCase())) { return false } if (selectedPlatform !== 'All' && auction.platform !== selectedPlatform) { return false } if (maxBid && auction.current_bid > parseFloat(maxBid)) { return false } return true }) const getTimeColor = (timeRemaining: string) => { if (timeRemaining.includes('m') && !timeRemaining.includes('h') && !timeRemaining.includes('d')) { return 'text-danger' } if (timeRemaining.includes('h') && parseInt(timeRemaining) < 2) { return 'text-warning' } return 'text-foreground-muted' } const getPlatformColor = (platform: string) => { switch (platform) { case 'GoDaddy': return 'bg-blue-500/10 text-blue-400' case 'Sedo': return 'bg-green-500/10 text-green-400' case 'NameJet': return 'bg-purple-500/10 text-purple-400' case 'SnapNames': return 'bg-orange-500/10 text-orange-400' case 'DropCatch': return 'bg-pink-500/10 text-pink-400' default: return 'bg-background-tertiary text-foreground-muted' } } if (authLoading) { return (
) } return (
{/* Ambient glow */}
{/* Header */}
Smart Pounce

Domain Auctions

Aggregated auctions from GoDaddy, Sedo, NameJet & more. Find undervalued domains before anyone else.

{/* Strategy Banner */}

Smart Pounce Strategy

We aggregate auctions from multiple platforms so you can find the best deals. We don't handle payments — click through to the platform to bid. Pro tip: Focus on auctions ending soon with low bid counts.

{/* Quick Stats */}
Active Auctions

{auctions.length}

Ending Soon

{endingSoon.length}

Hot Auctions

{hotAuctions.length}

Opportunities

{isAuthenticated ? opportunities.length : '—'}

{/* Tabs */}
{/* Filters (for All tab) */} {activeTab === 'all' && (
setSearchQuery(e.target.value)} className="w-full pl-11 pr-4 py-2.5 bg-background-secondary border border-border rounded-xl text-body-sm text-foreground placeholder:text-foreground-subtle focus:outline-none focus:border-border-hover transition-all" />
setMaxBid(e.target.value)} className="w-32 px-4 py-2.5 bg-background-secondary border border-border rounded-xl text-body-sm text-foreground placeholder:text-foreground-subtle focus:outline-none focus:border-border-hover" />
)} {/* Content */} {loading ? (
) : activeTab === 'all' ? ( /* All Auctions Grid */
{filteredAuctions.length === 0 ? (
No auctions match your filters
) : ( filteredAuctions.map((auction, idx) => (
{auction.domain} {auction.platform}
{auction.num_bids} bids {auction.age_years && ( {auction.age_years} years old )} {auction.traffic && ( {auction.traffic.toLocaleString()} visits/mo )}

Current Bid

{formatCurrency(auction.current_bid)}

Time Left

{auction.time_remaining}

Bid Now
{auction.buy_now_price && (
Buy Now: {formatCurrency(auction.buy_now_price)} {auction.reserve_met !== null && ( {auction.reserve_met ? 'Reserve Met' : 'Reserve Not Met'} )}
)}
)) )}
) : activeTab === 'opportunities' ? ( /* Smart Opportunities */ !isAuthenticated ? (

Sign in to see opportunities

Our algorithm finds undervalued domains based on your watchlist and market data.

Get Started Free
) : opportunities.length === 0 ? (
No opportunities found right now. Check back later!
) : (
{opportunities.map((opp, idx) => (
{opp.auction.domain} {opp.analysis.recommendation}
{/* Analysis Breakdown */}

Current Bid

{formatCurrency(opp.analysis.current_bid)}

Est. Value

{formatCurrency(opp.analysis.estimated_value)}

Value Ratio

{opp.analysis.value_ratio}×

Potential Profit

0 ? "text-accent" : "text-danger" )}> {opp.analysis.potential_profit > 0 ? '+' : ''} {formatCurrency(opp.analysis.potential_profit)}

Time Left

{opp.auction.time_remaining}

Bid Now
))}
) ) : ( /* Ending Soon */
{endingSoon.length === 0 ? (
No auctions ending soon
) : ( endingSoon.map((auction, idx) => (
{auction.domain} {auction.num_bids} bids on {auction.platform}

{formatCurrency(auction.current_bid)}

{auction.time_remaining}

Snipe Now
)) )}
)} {/* Disclaimer */}

How Smart Pounce Works

We aggregate domain auctions from multiple platforms (GoDaddy, Sedo, NameJet, etc.) and display them in one place. When you click "Bid Now", you're taken directly to the auction platform — we don't handle any payments or domain transfers. This keeps things simple and compliant with Swiss regulations.

) }